1
votes

Issue:

Have 1 active MDP (jmsIn below) attached to a single queue and keep the second clustered MDP on server 2 passive. I require only a single active process because I want to perform aggregation and not lose messages.

I have been reading about the control bus but since its a clustered environment , the channel id and jms:message-driven-channel-adapter id would have the save name on both servers. Is it possible for the control bus to deactivate on another server using JMX even though they have the id's? Or possibly have a check done first by the message-driven-channel-adapter to determine if there is already a connection active on the queue itself.

Message-driven-channel-adapter Sample Code:

<jms:message-driven-channel-adapter id="jmsIn"
        destination="requestQueue"
        channel="jmsInChannel" />

<channel id="jmsInChannel" />


<beans:beans profile="default">
    <stream:stdout-channel-adapter id="stdout" channel="jmsInChannel" append-newline="true"/>
</beans:beans>

<beans:beans profile="testCase">

    <bridge input-channel="jmsInChannel" output-channel="queueChannel"/>

    <channel id="queueChannel">
        <queue />
    </channel>

</beans:beans>
1

1 Answers

0
votes
  1. There is no reason to worry about clustered singleton for the <message-driven-channel-adapter>, just because any queuing system (like JMS) is designed for the single consumer for the particular message. In other words independently of the number of processes on the queue, only one of them picks up the message and process it.

  2. The Transaction semantics on JMS help you do not lose messages. If there is some Exception, the TX rallbacks and the message is returned to the queue and can be picked up by another consumer.

  3. For the aggregator you really can use some distributed persistent MessageStore. Where all your consumer send their messages to the same <aggregator> component which just deals with the shared MS to do its own aggregation logic.