标签:throws ann over cep print group class throw icp
1、先上例子:
pom依赖:
<dependencies>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>4.6.0</version>
</dependency>
</dependencies>
1 DefaultConsumer c = new DefaultConsumer(channel) { 2 @Override 3 public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body) 4 throws IOException { 5 System.out.println(new String(body)); 6 7 AMQP.BasicProperties.Builder builder = new AMQP.BasicProperties.Builder(); 8 builder.correlationId(properties.getCorrelationId()); 9 AMQP.BasicProperties prop = builder.build(); 10 11 channel.basicPublish("", properties.getReplyTo(), prop, (new String(body) + "-回复").getBytes()); 12 13 } 14 };
<dependencies> <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>4.6.0</version> </dependency> </dependencies>
标签:throws ann over cep print group class throw icp
原文地址:https://www.cnblogs.com/dairongsheng/p/9280037.html