mark for doc

This commit is contained in:
caixiang 2021-09-07 15:11:59 +08:00
parent 8369dad0b7
commit 15fbe0f14a
4 changed files with 24 additions and 22 deletions

View File

@ -40,24 +40,26 @@ public class ConfigOf00B {
public Queue MES_REQUEST_QUEUE_00B(){ public Queue MES_REQUEST_QUEUE_00B(){
Queue queue = new Queue(MES_REQUEST_QUEUE_00B); Queue queue = new Queue(MES_REQUEST_QUEUE_00B);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@Bean @Bean
public Queue MES_RESPONSE_QUEUE_00B(){ public Queue MES_RESPONSE_QUEUE_00B(){
Queue queue = new Queue(MES_RESPONSE_QUEUE_00B); Queue queue = new Queue(MES_RESPONSE_QUEUE_00B);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@Bean @Bean
public Queue EAP_REQUEST_QUEUE_00B(){ public Queue EAP_REQUEST_QUEUE_00B(){
Queue queue = new Queue(EAP_REQUEST_QUEUE_00B); Queue queue = new Queue(EAP_REQUEST_QUEUE_00B);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@ -65,8 +67,8 @@ public class ConfigOf00B {
public Queue EAP_RESPONSE_QUEUE_00B(){ public Queue EAP_RESPONSE_QUEUE_00B(){
Queue queue = new Queue(EAP_RESPONSE_QUEUE_00B); Queue queue = new Queue(EAP_RESPONSE_QUEUE_00B);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }

View File

@ -41,8 +41,8 @@ public class ConfigOf00C {
public Queue MES_REQUEST_QUEUE_00C(){ public Queue MES_REQUEST_QUEUE_00C(){
Queue queue = new Queue(MES_REQUEST_QUEUE_00C); Queue queue = new Queue(MES_REQUEST_QUEUE_00C);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@ -50,16 +50,16 @@ public class ConfigOf00C {
public Queue MES_RESPONSE_QUEUE_00C(){ public Queue MES_RESPONSE_QUEUE_00C(){
Queue queue = new Queue(MES_RESPONSE_QUEUE_00C); Queue queue = new Queue(MES_RESPONSE_QUEUE_00C);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@Bean @Bean
public Queue EAP_REQUEST_QUEUE_00C(){ public Queue EAP_REQUEST_QUEUE_00C(){
Queue queue = new Queue(EAP_REQUEST_QUEUE_00C); Queue queue = new Queue(EAP_REQUEST_QUEUE_00C);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }
@ -67,8 +67,8 @@ public class ConfigOf00C {
public Queue EAP_RESPONSE_QUEUE_00C(){ public Queue EAP_RESPONSE_QUEUE_00C(){
Queue queue = new Queue(EAP_RESPONSE_QUEUE_00C); Queue queue = new Queue(EAP_RESPONSE_QUEUE_00C);
queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE); queue.addArgument("x-dead-letter-exchange",ConfigOfDeadLetterQueue.EXCHANGE_NAME_DLE);
queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); queue.addArgument("x-dead-letter-routing-key",ConfigOfDeadLetterQueue.Dead_Letter_RoutingKey);
queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY); //queue.addArgument("x-max-priority",ConfigOfDeadLetterQueue.MAX_PRIORITY);
return queue; return queue;
} }

View File

@ -27,13 +27,13 @@ public class ConfigOfDeadLetterQueue {
* 所以 MES-Received 处理异常的 Message 都会被 投递到 Dead_Letter_Exchange => Dead_Letter_Queue(这个队列) * 所以 MES-Received 处理异常的 Message 都会被 投递到 Dead_Letter_Exchange => Dead_Letter_Queue(这个队列)
*/ */
public static final String EXCHANGE_NAME_DLE = "Dead_Letter_Exchange"; public static final String EXCHANGE_NAME_DLE = "Dead_Letter_Exchange";
public static final String EAP_REQUEST_QUEUE_DLE = "Dead_Letter_Queue"; public static final String Dead_Letter_Queue = "Dead_Letter_Queue";
public static final String EAP_REQUEST_QUEUE_ROUTINGKEY_DLE = "DL_For_MESReceived_Rk"; public static final String Dead_Letter_RoutingKey = "Dead_Letter_RoutingKey";
public static final Integer MAX_PRIORITY = 10; public static final Integer MAX_PRIORITY = 10;
@Bean @Bean
public Queue EAP_REQUEST_QUEUE_DLE(){ public Queue EAP_REQUEST_QUEUE_DLE(){
Queue queue = new Queue(EAP_REQUEST_QUEUE_DLE); Queue queue = new Queue(Dead_Letter_Queue);
queue.setIgnoreDeclarationExceptions(true); queue.setIgnoreDeclarationExceptions(true);
return queue; return queue;
@ -47,6 +47,6 @@ public class ConfigOfDeadLetterQueue {
@Bean @Bean
public Binding EAP_REQUEST_QUEUE_ROUTINGKEY_DLE(){ public Binding EAP_REQUEST_QUEUE_ROUTINGKEY_DLE(){
return BindingBuilder.bind(EAP_REQUEST_QUEUE_DLE()).to(EXCHANGE_NAME_DLE()) return BindingBuilder.bind(EAP_REQUEST_QUEUE_DLE()).to(EXCHANGE_NAME_DLE())
.with(EAP_REQUEST_QUEUE_ROUTINGKEY_DLE); .with(Dead_Letter_RoutingKey);
} }
} }

View File

@ -25,9 +25,9 @@ public class DeadLetterQueueReceived {
// ) // )
@RabbitListener(queues = ConfigOfDeadLetterQueue.EAP_REQUEST_QUEUE_DLE) @RabbitListener(queues = ConfigOfDeadLetterQueue.Dead_Letter_Queue)
@RabbitHandler @RabbitHandler
public void dlForPID00B(Message<?> message, Channel channel)throws Exception{ public void deadLetterQueue(Message<?> message, Channel channel)throws Exception{
System.out.println("线程名"+Thread.currentThread().hashCode()+"==============Dead_Letter_Exchange=================,"+",attr2"+message.getHeaders().get("attr2")); System.out.println("线程名"+Thread.currentThread().hashCode()+"==============Dead_Letter_Exchange=================,"+",attr2"+message.getHeaders().get("attr2"));