문제


I have a small requirement. I am going to read the data from some input files and load them into the jms queue, and let some consumers read the packets from the queue and processes them.
Is there any way to signal the consumers that the Input Data is finished, and they can safely shutthem down after processing the data they hold currently?

I am using Apache Active MQ.

Thanks,

올바른 솔루션이 없습니다

다른 팁

JMS implementers have a message grouping feature that allows messages to be grouped together and process messages in an order in that group. All the messages in a group are received by the same consumer. The messages in a group are ordered using a sequence number. JMS defines JMSXGroupdID and JMSXGroupSeq properties for this purpose.

You can use the JMSXGroupID property to group all the messages read from files and use a unique JMSXGroupSeq property for each message in the group. Consumers must look for messages with group id and start picking up messages until the JMSXGroupSeq property value is -1. That signals the end of the group.

Sample and more details are here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top