用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Azure-Samples/NewsFeedSite --skill rabbitmq-to-azureservicebus命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | rabbitmq-to-azureservicebus |
| description | Migrate from RabbitMQ to Azure Service Bus for messaging. |
This document provides comprehensive instructions for migrating from RabbitMQ to Azure Service Bus.
copy file awesomeasb-1.0.0.jar to classpath.
Add to your pom.xml:
<dependencies>
<dependency>
<groupId>com.awsomeasb</groupId>
<artifactId>awesomeasb</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Choose your SLF4J implementation -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.9</version>
</dependency>
</dependencies>
Add to your build.gradle:
dependencies {
implementation 'com.awsomeasb:awesomeasb:1.0.0'
implementation 'org.slf4j:slf4j-simple:2.0.9'
}
import com.awsomeasb.AwsomeMQClient;
import com.awsomeasb.DeliverCallback;
public class MyApplication {
public static void main(String[] args) {
String connectionString = System.getenv("AZURE_SERVICEBUS_CONNECTION_STRING");
String queueName = "myqueue";
try (AwsomeMQClient client = new AwsomeMQClient(connectionString, queueName)) {
// Publish a message
client.basicPublish(queueName, "Hello World!".getBytes());
// Consume messages
DeliverCallback callback = (tag, delivery) -> {
System.out.println("Received: " + delivery.getBodyAsString());
};
String consumerTag = client.basicConsume(queueName, true, callback);
Thread.sleep(10000);
client.basicCancel(consumerTag);
}
}
}
import com.awsomeasb.AwsomeMQClient;
// Uses DefaultAzureCredential (Azure CLI, Managed Identity, etc.)
try (AwsomeMQClient client = new AwsomeMQClient(
"myservicebus.servicebus.windows.net",
"myqueue",
null)) {
client.basicPublish("myqueue", "Secure message".getBytes());
}
// Publishing
void basicPublish(String routingKey, byte[] body)
void basicPublish(String routingKey, Map<String, Object> properties, byte[] body)
// Consuming
String basicConsume(String queueName, boolean autoAck, DeliverCallback callback)
String basicConsume(String queueName, boolean autoAck, DeliverCallback callback, CancelCallback cancelCallback)
// Consumer management
void basicCancel(String consumerTag)
// Message acknowledgment
void basicAck(Delivery delivery)
void basicNack(Delivery delivery, boolean requeue)
Issue: SLF4J warnings
Solution: Add an SLF4J implementation to your project (slf4j-simple, logback, log4j2, etc.)
Issue: Authentication failures with Managed Identity
Solution:
- Run 'az login' for local development
- Grant Azure Service Bus Data Sender/Receiver roles
- Verify namespace URL format: 'namespace.servicebus.windows.net'