You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jozsi_LXIII <jo...@ge.com> on 2012/07/26 09:58:29 UTC

How to keep sending in chronological order even when peer was down for a while

Hi,

We have to communicate between two JBoss servers via JMS.
In one JBoss we plan to use Camel to send messages to the other JBoss
instance.
One of the main requirements is to send messages in the same order as we
received them from the external system even the receiving JBoss was down or
communication was brocken for a while.
Example: Consumer JBoss is down and we receive 1000 messages which shall be
persisted to be able to send them later. If it's possible to send again
messages it shall be possible to first send out those 1000 messages by
keeping their chronological order before sending other messages received
during sending them.
For sure we could persist every messages in our RDBMS and then send them
from that pool but I'm asking my self if Camel would have this kind of
built-in functionality. I've already checked the Aggregation, HawtDb,
MongoDb etc, but I don't really know how to apply one of them to realize the
described functionality.
I also searched in the forum if analogue or same subject already discussed,
as you see, w/o success.
Thank you in advance
Greetings
Josef



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-keep-sending-in-chronological-order-even-when-peer-was-down-for-a-while-tp5716501.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to keep sending in chronological order even when peer was down for a while

Posted by Jozsi_LXIII <jo...@ge.com>.
Thank you Pontus and Willem for the recommendations.

We are using JBoss 4.0.4 and 5.1.0 and rather topics than queues and we have
several source systems (even our Jboss servers can do that) using several
protocols to provide messages for that topic.

Could be possible that we go for 7.1.1 for both but this is not yet decided
(due to HornetQ this would be an option).

Also the message exchange is only needed when both products (i.e.
servers) are installed.

The bridge between our servers , which  I've already tried out, works quite
fine, but there are some ugly side effects like having tons of errors in
case of problems.=20

As you can imagine, the customers don't want to analyze log files to find
out if connection is ok or not.

Giving access to the JMX console is also not an option.=20

Beside of these things the JMS persistence on these "old" JBoss versions is
RDBMS based, which means also that huge DB maintenance is required.

As you all know, the customer just want to see a green or red "traffic
light" and eventually the reason to be able to react.

I thought, maybe this kind of functionality is much easier to be realized
with Camel (including own local Db) than using that bridge.

I've checked again the possibilities in Camel and it looks like the MongoDb
would also be an option to persist the messages locally.

I have to take a closer look to that because first steps went wrong ;-)

Thank you again.




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-keep-sending-in-chronological-order-even-when-peer-was-down-for-a-while-tp5716501p5716542.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to keep sending in chronological order even when peer was down for a while

Posted by Willem Jiang <wi...@gmail.com>.
Yes, it is good way to leverage the Queue instead of managing the 
persistent of the message yourself.
If you just has one consumer per queue, we can make sure the FIFO as 
you want.

On Fri Jul 27 00:37:26 2012, Pontus Ullgren wrote:
> Hello,
>
> How do you receive the messages from the "external system"  is this
> via messaging (JMS or other means) or some other protocol such as HTTP
> ?
>
> Since you are already comfortable with JMS (or at least you will have
> to become) why not use a JMS queue to keep the messages on the first
> JBoss until they can be delivered to the second.
>
> First a camel route that receives message from external system and
> send it to a local JMS queue.
> Then a second camel route that acts as a simple message bridge between
> first and second JBoss passing the messages to the remote JMS queue.
>
> If you use HornetQ (default in JBoss 6+) you could use the HornetQ JMS
> bridge [1] instead of the second camel route.
> If you use HornetQ one important thing to remember is to NOT set the
> redelivery-delay on the local destination since this will break the
> order, instead if the connection to the remote fails close the
> connection to the local queue until the connection is resumed.
>
> [1] http://docs.jboss.org/hornetq/2.2.14.Final/user-manual/en/html/jms-bridge.html#quality-of-service
>
> // Pontus
>
>
>
> On Thu, Jul 26, 2012 at 9:58 AM, Jozsi_LXIII <jo...@ge.com> wrote:
>> Hi,
>>
>> We have to communicate between two JBoss servers via JMS.
>> In one JBoss we plan to use Camel to send messages to the other JBoss
>> instance.
>> One of the main requirements is to send messages in the same order as we
>> received them from the external system even the receiving JBoss was down or
>> communication was brocken for a while.
>> Example: Consumer JBoss is down and we receive 1000 messages which shall be
>> persisted to be able to send them later. If it's possible to send again
>> messages it shall be possible to first send out those 1000 messages by
>> keeping their chronological order before sending other messages received
>> during sending them.
>> For sure we could persist every messages in our RDBMS and then send them
>> from that pool but I'm asking my self if Camel would have this kind of
>> built-in functionality. I've already checked the Aggregation, HawtDb,
>> MongoDb etc, but I don't really know how to apply one of them to realize the
>> described functionality.
>> I also searched in the forum if analogue or same subject already discussed,
>> as you see, w/o success.
>> Thank you in advance
>> Greetings
>> Josef
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/How-to-keep-sending-in-chronological-order-even-when-peer-was-down-for-a-while-tp5716501.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang


Re: How to keep sending in chronological order even when peer was down for a while

Posted by Pontus Ullgren <ul...@gmail.com>.
Hello,

How do you receive the messages from the "external system"  is this
via messaging (JMS or other means) or some other protocol such as HTTP
?

Since you are already comfortable with JMS (or at least you will have
to become) why not use a JMS queue to keep the messages on the first
JBoss until they can be delivered to the second.

First a camel route that receives message from external system and
send it to a local JMS queue.
Then a second camel route that acts as a simple message bridge between
first and second JBoss passing the messages to the remote JMS queue.

If you use HornetQ (default in JBoss 6+) you could use the HornetQ JMS
bridge [1] instead of the second camel route.
If you use HornetQ one important thing to remember is to NOT set the
redelivery-delay on the local destination since this will break the
order, instead if the connection to the remote fails close the
connection to the local queue until the connection is resumed.

[1] http://docs.jboss.org/hornetq/2.2.14.Final/user-manual/en/html/jms-bridge.html#quality-of-service

// Pontus



On Thu, Jul 26, 2012 at 9:58 AM, Jozsi_LXIII <jo...@ge.com> wrote:
> Hi,
>
> We have to communicate between two JBoss servers via JMS.
> In one JBoss we plan to use Camel to send messages to the other JBoss
> instance.
> One of the main requirements is to send messages in the same order as we
> received them from the external system even the receiving JBoss was down or
> communication was brocken for a while.
> Example: Consumer JBoss is down and we receive 1000 messages which shall be
> persisted to be able to send them later. If it's possible to send again
> messages it shall be possible to first send out those 1000 messages by
> keeping their chronological order before sending other messages received
> during sending them.
> For sure we could persist every messages in our RDBMS and then send them
> from that pool but I'm asking my self if Camel would have this kind of
> built-in functionality. I've already checked the Aggregation, HawtDb,
> MongoDb etc, but I don't really know how to apply one of them to realize the
> described functionality.
> I also searched in the forum if analogue or same subject already discussed,
> as you see, w/o success.
> Thank you in advance
> Greetings
> Josef
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-keep-sending-in-chronological-order-even-when-peer-was-down-for-a-while-tp5716501.html
> Sent from the Camel - Users mailing list archive at Nabble.com.