简体   繁体   中英

What happens when message is rejected in Jgroups?

I am using axon with distributed command bus which uses Jgroups for creating clusters. I fire approximately 100 messages. I have the following configuration for tcp-gossip.xml:

 sock_conn_timeout="300" 
 reaper_interval="0"

 thread_pool.enabled="true"
 thread_pool.min_threads="3"
 thread_pool.max_threads="3"
 max_bundle_timeout="10"


 level="trace"       
 thread_pool.rejection_policy="Abort"

 recv_buf_size="64K"
 send_buf_size="20M"
 />

I get a java.util.concurrent.RejectedExecutionException when running with this configuration which is but obvious because the rejection_policy is abort. But the message which is rejected is picked again and it is executed and also the order of execution is preserved. That means the message is kept somewhere in the buffer.
1> Does anyone know that where are the messages buffered in the JGroups.
2> Can any one explain exactly what exactly happens when we use abort rejection_policy ?

1) Messages are stored in UNICASTx or pbcast.NAKACKx protocols until these are confirmed to be received by all recipients.

2) In JGroups, there is non-trivial threading model. Messages are read from network in the receive thread and then passed to one of the three threadpools (regular, OOB and internal) for processing in the stack and application delivery. When the threadpool is busy and there is no queue configured/queue is full, the threadpool will reject the job, the message will be discarded on receiver side. Luckily, it will be resent later. You can monitor the number of rejected messages on TP.num_rejected_messages using JMX or probe.sh.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM