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…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Messaging Integration Testing — Multi-Broker Reference
Dedicated skills: For Kafka testing see
messaging-testing-kafka. For RabbitMQ testing seemessaging-testing-rabbitmq.
Redis Pub/Sub
Java: Testcontainers GenericContainer
@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
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
@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
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+)
@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
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>pulsar</artifactId>
<sc
Установить messaging-testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл 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
Как установить скилл messaging-testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл messaging-testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic