messaging-testing
Integration testing patterns for messaging brokers: Redis Pub/Sub, NATS, Pulsar, SQS, ActiveMQ, Azure Service Bus, and Google Pub/Sub. Container-based and emulator-based testing for Java, Node.js, and Python. USE WHEN: user mentions "messaging test", "redis pubsub test", "nats test", "pulsar test", "sqs test", "localstack test", "activemq test", "azure service bus test", "google pubsub test", "message queue test" DO NOT USE FOR: Kafka testing - use `messaging-testing-kafka`; RabbitMQ testing - use `messaging-testing-rabbitmq`; Generic testcontainers - use `testcontainers` skill
What this skill does
# Messaging Integration Testing — Multi-Broker Reference
> **Dedicated skills**: For Kafka testing see `messaging-testing-kafka`. For RabbitMQ testing see `messaging-testing-rabbitmq`.
## Redis Pub/Sub
### Java: Testcontainers GenericContainer
```java
@SpringBootTest
@Testcontainers
class RedisPubSubTest {
@Container
@ServiceConnection(name = "redis")
static GenericContainer<?> redis =
new GenericContainer<>("redis:7-alpine").withExposedPorts(6379);
@Autowired
private StringRedisTemplate redisTemplate;
@Test
void shouldPublishAndReceive() {
List<String> received = new CopyOnWriteArrayList<>();
CountDownLatch latch = new CountDownLatch(1);
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
container.setConnectionFactory(redisTemplate.getConnectionFactory());
container.addMessageListener((message, pattern) -> {
received.add(new String(message.getBody()));
latch.countDown();
}, new ChannelTopic("orders"));
container.afterPropertiesSet();
container.start();
redisTemplate.convertAndSend("orders", "{\"orderId\":\"123\"}");
assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue();
assertThat(received).hasSize(1);
assertThat(received.get(0)).contains("123");
container.stop();
}
}
```
### Node.js: ioredis + Testcontainers
```typescript
import { GenericContainer } from "testcontainers";
import Redis from "ioredis";
let container, publisher, subscriber;
beforeAll(async () => {
container = await new GenericContainer("redis:7-alpine")
.withExposedPorts(6379).start();
const url = `redis://${container.getHost()}:${container.getMappedPort(6379)}`;
publisher = new Redis(url);
subscriber = new Redis(url);
}, 30_000);
afterAll(async () => {
await publisher.quit();
await subscriber.quit();
await container.stop();
});
it("should pub/sub", async () => {
const messages: string[] = [];
await subscriber.subscribe("orders");
subscriber.on("message", (ch, msg) => messages.push(msg));
await publisher.publish("orders", JSON.stringify({ orderId: "123" }));
await new Promise((r) => setTimeout(r, 500));
expect(messages).toHaveLength(1);
expect(JSON.parse(messages[0]).orderId).toBe("123");
});
```
## NATS
### Java: Testcontainers
```java
@SpringBootTest
@Testcontainers
class NatsTest {
@Container
static GenericContainer<?> nats =
new GenericContainer<>("nats:2.10-alpine").withExposedPorts(4222);
@DynamicPropertySource
static void natsProperties(DynamicPropertyRegistry registry) {
registry.add("nats.url", () ->
"nats://" + nats.getHost() + ":" + nats.getMappedPort(4222));
}
@Test
void shouldPublishAndSubscribe() throws Exception {
Connection nc = Nats.connect(
"nats://" + nats.getHost() + ":" + nats.getMappedPort(4222));
CompletableFuture<Message> future = new CompletableFuture<>();
Dispatcher dispatcher = nc.createDispatcher(future::complete);
dispatcher.subscribe("orders");
nc.publish("orders", "{\"orderId\":\"123\"}".getBytes());
Message msg = future.get(5, TimeUnit.SECONDS);
assertThat(new String(msg.getData())).contains("123");
nc.close();
}
}
```
### Node.js: nats + Testcontainers
```typescript
import { GenericContainer } from "testcontainers";
import { connect, StringCodec } from "nats";
it("should pub/sub via NATS", async () => {
const container = await new GenericContainer("nats:2.10-alpine")
.withExposedPorts(4222).start();
const nc = await connect({
servers: `nats://${container.getHost()}:${container.getMappedPort(4222)}`,
});
const sc = StringCodec();
const messages: string[] = [];
const sub = nc.subscribe("orders");
(async () => { for await (const msg of sub) messages.push(sc.decode(msg.data)); })();
nc.publish("orders", sc.encode(JSON.stringify({ orderId: "123" })));
await nc.flush();
await new Promise((r) => setTimeout(r, 500));
expect(messages).toHaveLength(1);
await nc.close();
await container.stop();
});
```
## Apache Pulsar
### Java: PulsarContainer + @ServiceConnection (Spring Boot 3.2+)
```java
@SpringBootTest
@Testcontainers
class PulsarTest {
@Container
@ServiceConnection
static PulsarContainer pulsar = new PulsarContainer("apachepulsar/pulsar:3.2.0");
@Autowired
private PulsarTemplate<String> pulsarTemplate;
@Test
void shouldProduceAndConsume() throws Exception {
pulsarTemplate.send("orders", "order-123");
// Consumer verifies via listener or direct consumer API
await().atMost(Duration.ofSeconds(10))
.untilAsserted(() -> {
// Assert side effect of listener processing
});
}
}
```
### Dependencies
```xml
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>pulsar</artifactId>
<scope>test</scope>
</dependency>
```
## Amazon SQS (LocalStack)
### Java: LocalStack + @DynamicPropertySource
```java
@SpringBootTest
@Testcontainers
class SqsTest {
@Container
static LocalStackContainer localstack = new LocalStackContainer(
DockerImageName.parse("localstack/localstack:3.4"))
.withServices(Service.SQS);
@DynamicPropertySource
static void sqsProperties(DynamicPropertyRegistry registry) {
registry.add("spring.cloud.aws.sqs.endpoint",
() -> localstack.getEndpointOverride(Service.SQS).toString());
registry.add("spring.cloud.aws.region.static", () -> localstack.getRegion());
registry.add("spring.cloud.aws.credentials.access-key", localstack::getAccessKey);
registry.add("spring.cloud.aws.credentials.secret-key", localstack::getSecretKey);
}
@BeforeAll
static void createQueue() throws Exception {
localstack.execInContainer("awslocal", "sqs", "create-queue",
"--queue-name", "orders-queue");
}
@Autowired
private SqsTemplate sqsTemplate;
@Test
void shouldSendAndReceive() {
sqsTemplate.send("orders-queue", new OrderEvent("123", "CREATED"));
await().atMost(Duration.ofSeconds(10))
.untilAsserted(() -> {
// Assert consumer processed the message
});
}
}
```
### Node.js: LocalStack + @aws-sdk
```typescript
import { LocalstackContainer } from "@testcontainers/localstack";
import { SQSClient, CreateQueueCommand, SendMessageCommand, ReceiveMessageCommand } from "@aws-sdk/client-sqs";
it("should send and receive SQS message", async () => {
const container = await new LocalstackContainer("localstack/localstack:3.4").start();
const client = new SQSClient({
endpoint: container.getConnectionUri(),
region: "us-east-1",
credentials: { accessKeyId: "test", secretAccessKey: "test" },
});
const { QueueUrl } = await client.send(
new CreateQueueCommand({ QueueName: "test-queue" }));
await client.send(new SendMessageCommand({
QueueUrl, MessageBody: JSON.stringify({ orderId: "123" }),
}));
const { Messages } = await client.send(
new ReceiveMessageCommand({ QueueUrl, WaitTimeSeconds: 5 }));
expect(Messages).toHaveLength(1);
expect(JSON.parse(Messages![0].Body!).orderId).toBe("123");
await container.stop();
});
```
### Python: moto (Mock) or LocalStack
```python
import boto3
from moto import mock_aws
@mock_aws
def test_sqs_send_receive():
sqs = boto3.client("sqs", region_name="us-east-1")
queue = sqs.create_queue(QueueName="test-queue")
queue_url = queue["QueueUrl"]
sqs.send_message(QueueUrl=queue_url, MessageBody='{"orderId": "123"}')
response = sqs.receive_message(QueueUrl=queue_url, MaxNumberOfMessages=1)
assert len(response["Messages"]) == 1
assert "123" in response["Messages"][0]["Body"]
```
## ActiveMQ (Artemis)
### Java: EmbeddedActiveMQ (In-Process)
```java
@SpringBootTest
class ActiRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.