Skip to content

Commit 3a787e2

Browse files
committed
Publishing site Sun Oct 19 20:34:10 CEST 2025
1 parent 563f79a commit 3a787e2

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

documentation/guides/usage/async-protocols/aws-sqs-sns-support/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
<i class="fas fa-chevron-down toggle-icon"></i></a><ul class=mobile-submenu><li data-nav-id=https://microcks.io/documentation/references/container-images/ title="Container Images" class=sidelist-mobile><a href=https://microcks.io/documentation/references/container-images/ class="d-flex align-items-center justify-content-between"><span>Container Images</span></a><li data-nav-id=https://microcks.io/documentation/references/templates/ title="Mock Templates" class=sidelist-mobile><a href=https://microcks.io/documentation/references/templates/ class="d-flex align-items-center justify-content-between"><span>Mock Templates</span></a><li data-nav-id=https://microcks.io/documentation/references/test-endpoints/ title="Test Parameters" class=sidelist-mobile><a href=https://microcks.io/documentation/references/test-endpoints/ class="d-flex align-items-center justify-content-between"><span>Test Parameters</span></a><li data-nav-id=https://microcks.io/documentation/references/metadada/ title="API Metadata Format" class=sidelist-mobile><a href=https://microcks.io/documentation/references/metadada/ class="d-flex align-items-center justify-content-between"><span>API Metadata Format</span></a><li data-nav-id=https://microcks.io/documentation/references/examples/ title="API Examples Format" class=sidelist-mobile><a href=https://microcks.io/documentation/references/examples/ class="d-flex align-items-center justify-content-between"><span>API Examples Format</span></a><li data-nav-id=https://microcks.io/documentation/references/testcontainers-modules/ title="Testcontainers Modules" class=sidelist-mobile><a href=https://microcks.io/documentation/references/testcontainers-modules/ class="d-flex align-items-center justify-content-between"><span>Testcontainers Modules</span></a><li data-nav-id=https://microcks.io/documentation/references/artifacts/ title="Artifacts Reference" class=sidelist-mobile><a href=https://microcks.io/documentation/references/artifacts/ class="d-flex align-items-center justify-content-between"><span><i class="fa-solid fa-caret-right"></i> &nbsp; Artifacts Reference</span>
4444
<i class="fas fa-chevron-down toggle-icon"></i></a><li data-nav-id=https://microcks.io/documentation/references/configuration/ title="Configuration Reference" class=sidelist-mobile><a href=https://microcks.io/documentation/references/configuration/ class="d-flex align-items-center justify-content-between"><span><i class="fa-solid fa-caret-right"></i> &nbsp; Configuration Reference</span>
4545
<i class="fas fa-chevron-down toggle-icon"></i></a><li data-nav-id=https://microcks.io/documentation/references/apis/ title="API Reference" class=sidelist-mobile><a href=https://microcks.io/documentation/references/apis/ class="d-flex align-items-center justify-content-between"><span><i class="fa-solid fa-caret-right"></i> &nbsp; API Reference</span>
46-
<i class="fas fa-chevron-down toggle-icon"></i></a></ul></li></ul></div></div></div></div><div class="col-xl-8 col-lg-9 col-md-8"><div class="px-lg-5 px-sm-4 py-5"><h2 class="mb-4 fw-bold">SQS/SNS Mocking & Testing</h2><span class="text-muted fw-300">🗓️ Last updated on May 13, 2024
46+
<i class="fas fa-chevron-down toggle-icon"></i></a></ul></li></ul></div></div></div></div><div class="col-xl-8 col-lg-9 col-md-8"><div class="px-lg-5 px-sm-4 py-5"><h2 class="mb-4 fw-bold">SQS/SNS Mocking & Testing</h2><span class="text-muted fw-300">🗓️ Last updated on October 19, 2025
4747
<span class="mx-1 text-dark-50 fw-300">|</span> <i class="far fa-clock text-dark me-1"></i> 10
4848
<span class="mx-1 text-dark-50 fw-300">|</span> <a href=https://github.com/microcks/microcks.io/edit/master/content/documentation/guides/usage/async-protocols/aws-sqs-sns-support.md class="f6 ph3 pv1 br2 dib tc ttu mv3 bg-primary-color white hover-bg-green link">Improve this page</a></span><div class="doc-content mt-4 pt-4" data-bs-spy=scroll data-bs-target=#TableOfContents data-bs-offset=20><h2 id=overview>Overview</h2><p>This guide shows you how to use a <a href=https://aws.amazon.com/sqs/ target=_blank>Amazon SQS</a> and <a href=https://aws.amazon.com/sns/ target=_blank>Amazon SNS</a> messaging service with Microcks. As those two services are very frequently used in combination, we decided to cover both of them in the same guide as principles and configuration are very similar. However, Microcks may provide mocking and testing services for SQS only and mocking and testing services for SNS only. You don&rsquo;t have to use both to benefit from Microcks&rsquo; features.</p><p>Amazon Simple Queue Service (SQS) lets you send, store, and receive messages between software components. As the name suggests, it is a message queuing service where one message from a queue can only be consumed by one component. Amazon Simple Notification Service (SNS) sends notifications in two ways and provides high-throughput, push-based, many-to-many messaging between distributed systems, microservices, and event-driven serverless applications.</p><p>Microcks supports Amazon SQS and SNS as protocol bindings for <a href=/documentation/references/artifacts/asyncapi-conventions/>AsyncAPI</a>. That means that Microcks is able to connect to either SQS or SNS service for publishing mock messages as soon as it receives a valid <a href=https://asyncapi.com target=_blank>AsyncAPI</a> Specification and to connect to any SQS/SNS queue or topic to check that flowing messages are compliant with the schema described within your specification.</p><p>Let&rsquo;s go! 🏄‍♂️</p><h2 id=1-set-up-the-aws-services-connection>1. Set up the AWS services connection</h2><p>The first mandatory step is to set up Microcks so that it can connect to the target AWS service for sending mock messages. To do that, you&rsquo;ll need to ensure that you have the proper credentials in your cluster.</p><p>As accessing AWS Service is subject to authentication and authorization, the prerequisite is to create one <a href=https://aws.amazon.com/iam/ target=_blank>IAM Account</a> with the required policies. If you plan to use both services, we recommend creating two different accounts so that you&rsquo;ll limit the scope of risk.</p><p>Once you prepare your IAM account, you&rsquo;ll need its access keys so that an application running outside of AWS can use those services.</p><p>From there, you have two options to provide the access keys details to Microcks:</p><ol><li>Store these access key details directly as keys into a Kubernetes <code>Secret</code>, keys that will be injected as environment variables within your Microcks instance,</li><li>Store these access key details in a <a href=https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html target=_blank>Profile file</a>, you&rsquo;ll also wrap it into a Kubernetes <code>Secret</code>. This Secret will be mounted on Microcks&rsquo; instance filesystem in read-only mode.</li></ol><p>Depending on the option you chose and the way you handle secrets in your cluster, you&rsquo;ll typically have to issue these commands.</p><p><strong>Create a Secret for environment variable usage:</strong></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh><span style=display:flex><span>kubectl create secret generic my-aws-credentials <span style=color:#ae81ff>\
49-
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>access_key_id<span style=color:#f92672>=</span> AWS_ACCESS_KEY_ID <span style=color:#ae81ff>\
50-
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>secret_access_key<span style=color:#f92672>=</span> AWS_SECRET_ACCESS_KEY <span style=color:#ae81ff>\
51-
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>secret_token_key<span style=color:#f92672>=</span> AWS_SESSION_TOKEN <span style=color:#ae81ff>\
49+
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>access_key_id<span style=color:#f92672>=</span>$AWS_ACCESS_KEY_ID <span style=color:#ae81ff>\
50+
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>secret_access_key<span style=color:#f92672>=</span>$AWS_SECRET_ACCESS_KEY <span style=color:#ae81ff>\
51+
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-literal<span style=color:#f92672>=</span>secret_token_key<span style=color:#f92672>=</span>$AWS_SESSION_TOKEN <span style=color:#ae81ff>\
5252
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> -n microcks
5353
</span></span></code></pre></div><p><strong>Create a Secret for profile file usage:</strong></p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh><span style=display:flex><span>kubectl create secret generic my-aws-credentials <span style=color:#ae81ff>\
5454
</span></span></span><span style=display:flex><span><span style=color:#ae81ff></span> --from-file<span style=color:#f92672>=</span>./my-aws-credentials.profile -n microcks
@@ -88,7 +88,7 @@
8888
</span></span><span style=display:flex><span> <span style=color:#f92672>credentialsType</span>: <span style=color:#ae81ff>env-variable</span>
8989
</span></span><span style=display:flex><span> <span style=color:#f92672>credentialsSecretRef</span>:
9090
</span></span><span style=display:flex><span> <span style=color:#f92672>secret</span>: <span style=color:#ae81ff>my-aws-credentials</span>
91-
</span></span></code></pre></div><p>The actual connection to the Google Pub/Sub service will only be made once Microcks sends mock messages to it. Let&rsquo;s see below how to use Pub/Sub binding with AsyncAPI.</p><blockquote><p>Running AWS on [LocalStack] (<a href=https://localstack.cloud target=_blank>https://localstack.cloud</a>)? Microcks supports that, too! Each configuration section (for SQS and SNS) allows you to provide an optional <code>endpointOverride</code> property that will allow you to target your LocalStack instance.</p><p>You&rsquo;ll end up with something like <code>features.async.sqs.endpointOverride=http://localhost:4566</code> for example.</p></blockquote><h2 id=2-use-aws-services-in-asyncapi>2. Use AWS services in AsyncAPI</h2><p>As SQS and SNS are not the default bindings in Microcks, you should explicitly add them as a valid binding within your AsyncAPI contract. Below is a fragment of the AsyncAPI specification file that shows the important things to notice when planning to use SQS and Microcks with AsyncAPI. It comes with one sample you can find on our <a href=https://github.com/microcks/microcks/blob/1.7.x/samples/UserSignedUpAPI-asyncapi-sqs.yml target=_blank>GitHub repository</a>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span><span style=color:#f92672>asyncapi</span>: <span style=color:#e6db74>&#39;2.1.0&#39;</span>
91+
</span></span></code></pre></div><p>The actual connection to the Google Pub/Sub service will only be made once Microcks sends mock messages to it. Let&rsquo;s see below how to use Pub/Sub binding with AsyncAPI.</p><blockquote><p>Running AWS on <a href=https://localstack.cloud target=_blank>LocalStack</a>? Microcks supports that, too! Each configuration section (for SQS and SNS) allows you to provide an optional <code>endpointOverride</code> property that will allow you to target your LocalStack instance.</p><p>You&rsquo;ll end up with something like <code>features.async.sqs.endpointOverride=http://localhost:4566</code> for example.</p></blockquote><h2 id=2-use-aws-services-in-asyncapi>2. Use AWS services in AsyncAPI</h2><p>As SQS and SNS are not the default bindings in Microcks, you should explicitly add them as a valid binding within your AsyncAPI contract. Below is a fragment of the AsyncAPI specification file that shows the important things to notice when planning to use SQS and Microcks with AsyncAPI. It comes with one sample you can find on our <a href=https://github.com/microcks/microcks/blob/1.7.x/samples/UserSignedUpAPI-asyncapi-sqs.yml target=_blank>GitHub repository</a>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span><span style=color:#f92672>asyncapi</span>: <span style=color:#e6db74>&#39;2.1.0&#39;</span>
9292
</span></span><span style=display:flex><span><span style=color:#f92672>id</span>: <span style=color:#e6db74>&#39;urn:io.microcks.example.user-signedup&#39;</span>
9393
</span></span><span style=display:flex><span>[<span style=color:#ae81ff>...]</span>
9494
</span></span><span style=display:flex><span><span style=color:#f92672>channels</span>:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Async Protocols on API Mocking and Testing | Microcks.io</title><link>https://microcks.io/documentation/guides/usage/async-protocols/</link><description>Recent content in Async Protocols on API Mocking and Testing | Microcks.io</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 13 May 2024 00:00:00 +0200</lastBuildDate><atom:link href="https://microcks.io/documentation/guides/usage/async-protocols/index.xml" rel="self" type="application/rss+xml"/><item><title>Kafka, Avro &amp; Schema Registry</title><link>https://microcks.io/documentation/guides/usage/async-protocols/avro-messaging/</link><pubDate>Fri, 12 Feb 2021 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/avro-messaging/</guid><description>Overview This guide shows you how to use Microcks for mocking and testing Avro encoding on top of Apache Kafka.</description></item><item><title>MQTT Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/mqtt-support/</link><pubDate>Mon, 15 Feb 2021 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/mqtt-support/</guid><description>Overview This guide shows you how to use the Message Queuing Telemetry Transport (MQTT) protocol with Microcks.</description></item><item><title>RabbitMQ Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/rabbitmq-support/</link><pubDate>Tue, 22 Nov 2022 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/rabbitmq-support/</guid><description>Overview This guide shows you how to use the RabbitMQ protocol with Microcks.</description></item><item><title>NATS Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/nats-support/</link><pubDate>Mon, 30 Jan 2023 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/nats-support/</guid><description>Overview This guide shows you how to use a NATS protocol with Microcks.</description></item><item><title>Pub/Sub Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/googlepubsub-support/</link><pubDate>Wed, 08 Feb 2023 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/googlepubsub-support/</guid><description>Overview This guide shows you how to use a Google Pub/Sub messaging service with Microcks.</description></item><item><title>SQS/SNS Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/aws-sqs-sns-support/</link><pubDate>Tue, 06 Jun 2023 00:00:00 +0200</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/aws-sqs-sns-support/</guid><description>Overview This guide shows you how to use a Amazon SQS and Amazon SNS messaging service with Microcks.</description></item></channel></rss>
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Async Protocols on API Mocking and Testing | Microcks.io</title><link>https://microcks.io/documentation/guides/usage/async-protocols/</link><description>Recent content in Async Protocols on API Mocking and Testing | Microcks.io</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 19 Oct 2025 00:00:00 +0200</lastBuildDate><atom:link href="https://microcks.io/documentation/guides/usage/async-protocols/index.xml" rel="self" type="application/rss+xml"/><item><title>Kafka, Avro &amp; Schema Registry</title><link>https://microcks.io/documentation/guides/usage/async-protocols/avro-messaging/</link><pubDate>Fri, 12 Feb 2021 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/avro-messaging/</guid><description>Overview This guide shows you how to use Microcks for mocking and testing Avro encoding on top of Apache Kafka.</description></item><item><title>MQTT Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/mqtt-support/</link><pubDate>Mon, 15 Feb 2021 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/mqtt-support/</guid><description>Overview This guide shows you how to use the Message Queuing Telemetry Transport (MQTT) protocol with Microcks.</description></item><item><title>RabbitMQ Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/rabbitmq-support/</link><pubDate>Tue, 22 Nov 2022 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/rabbitmq-support/</guid><description>Overview This guide shows you how to use the RabbitMQ protocol with Microcks.</description></item><item><title>NATS Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/nats-support/</link><pubDate>Mon, 30 Jan 2023 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/nats-support/</guid><description>Overview This guide shows you how to use a NATS protocol with Microcks.</description></item><item><title>Pub/Sub Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/googlepubsub-support/</link><pubDate>Wed, 08 Feb 2023 00:00:00 +0100</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/googlepubsub-support/</guid><description>Overview This guide shows you how to use a Google Pub/Sub messaging service with Microcks.</description></item><item><title>SQS/SNS Mocking &amp; Testing</title><link>https://microcks.io/documentation/guides/usage/async-protocols/aws-sqs-sns-support/</link><pubDate>Tue, 06 Jun 2023 00:00:00 +0200</pubDate><guid>https://microcks.io/documentation/guides/usage/async-protocols/aws-sqs-sns-support/</guid><description>Overview This guide shows you how to use a Amazon SQS and Amazon SNS messaging service with Microcks.</description></item></channel></rss>

index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)