You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Joe Carter <jo...@gmail.com> on 2011/11/29 17:27:26 UTC

Buffering producer messages

Hi,

Does anyone know how to configure the connection factory so that it
will buffer messages while there's a temporary outage to the broker?
Basically the same as the "Buffered JMS client" in the IBM MQ product
http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
At the moment my application receives exceptions until the connection
recovers and I can't afford to block (its a soft real time app).
If not I'll write my own wrapper but I'd be surprised if there's not
one out there already.

Thanks
Joe

Re: Buffering producer messages

Posted by Joe Carter <jo...@gmail.com>.
Thank you. Much appreciated.

On 1 December 2011 18:41, Gary Tully <ga...@gmail.com> wrote:
> That is all good, but don't use static:(failover://) for the network
> connector, just use static:(tcp:// ) and the network connector will
> handle any failure by restarting the network bridge.
> failover: can get in the way of network bridge recovery/restart and
> leave the network bridge in limbo. It is intended for use with jms
> clients, the network bridge is a little more than a plain jms client
> as it multiplexes messages from many clients and monitors advisories
> and control messages etc.
>
> On 1 December 2011 10:22, Joe Carter <jo...@gmail.com> wrote:
>> As I require persistence on the messages, I configured the embedded
>> broker to use the MemoryPersistenceAdapter.
>> This allows me to set the persistent flag which I presume will be
>> carried forward into my remote broker which really will persist the
>> message.
>> My network connector using the following URI:
>> static:(failover:(nio://localhost:61616)?trackMessages=true) so I
>> shouldn't lose any messages from the embedded to the remote broker.
>> I do realise that a failure of the process with the embedded broker
>> will lose any in-flight messages that haven't made it to the remote
>> broker, but for my application that risk is acceptable.
>> Let me know if that doesn't do what I expect.
>>
>> Thanks for the help.
>> Joe
>>
>> On 30 November 2011 16:25, Gary Tully <ga...@gmail.com> wrote:
>>> the typical activemq way to do that is use an embeded vm broker and a
>>> network connector to forward messages to the target when it can.
>>> Disable persistence and it will use a memory store so it will be have
>>> like a buffer.
>>>
>>> On 29 November 2011 16:27, Joe Carter <jo...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> Does anyone know how to configure the connection factory so that it
>>>> will buffer messages while there's a temporary outage to the broker?
>>>> Basically the same as the "Buffered JMS client" in the IBM MQ product
>>>> http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
>>>> At the moment my application receives exceptions until the connection
>>>> recovers and I can't afford to block (its a soft real time app).
>>>> If not I'll write my own wrapper but I'd be surprised if there's not
>>>> one out there already.
>>>>
>>>> Thanks
>>>> Joe
>>>
>>>
>>>
>>> --
>>> http://fusesource.com
>>> http://blog.garytully.com
>
>
>
> --
> http://fusesource.com
> http://blog.garytully.com

Re: Buffering producer messages

Posted by Gary Tully <ga...@gmail.com>.
That is all good, but don't use static:(failover://) for the network
connector, just use static:(tcp:// ) and the network connector will
handle any failure by restarting the network bridge.
failover: can get in the way of network bridge recovery/restart and
leave the network bridge in limbo. It is intended for use with jms
clients, the network bridge is a little more than a plain jms client
as it multiplexes messages from many clients and monitors advisories
and control messages etc.

On 1 December 2011 10:22, Joe Carter <jo...@gmail.com> wrote:
> As I require persistence on the messages, I configured the embedded
> broker to use the MemoryPersistenceAdapter.
> This allows me to set the persistent flag which I presume will be
> carried forward into my remote broker which really will persist the
> message.
> My network connector using the following URI:
> static:(failover:(nio://localhost:61616)?trackMessages=true) so I
> shouldn't lose any messages from the embedded to the remote broker.
> I do realise that a failure of the process with the embedded broker
> will lose any in-flight messages that haven't made it to the remote
> broker, but for my application that risk is acceptable.
> Let me know if that doesn't do what I expect.
>
> Thanks for the help.
> Joe
>
> On 30 November 2011 16:25, Gary Tully <ga...@gmail.com> wrote:
>> the typical activemq way to do that is use an embeded vm broker and a
>> network connector to forward messages to the target when it can.
>> Disable persistence and it will use a memory store so it will be have
>> like a buffer.
>>
>> On 29 November 2011 16:27, Joe Carter <jo...@gmail.com> wrote:
>>> Hi,
>>>
>>> Does anyone know how to configure the connection factory so that it
>>> will buffer messages while there's a temporary outage to the broker?
>>> Basically the same as the "Buffered JMS client" in the IBM MQ product
>>> http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
>>> At the moment my application receives exceptions until the connection
>>> recovers and I can't afford to block (its a soft real time app).
>>> If not I'll write my own wrapper but I'd be surprised if there's not
>>> one out there already.
>>>
>>> Thanks
>>> Joe
>>
>>
>>
>> --
>> http://fusesource.com
>> http://blog.garytully.com



-- 
http://fusesource.com
http://blog.garytully.com

Re: Buffering producer messages

Posted by Joe Carter <jo...@gmail.com>.
As I require persistence on the messages, I configured the embedded
broker to use the MemoryPersistenceAdapter.
This allows me to set the persistent flag which I presume will be
carried forward into my remote broker which really will persist the
message.
My network connector using the following URI:
static:(failover:(nio://localhost:61616)?trackMessages=true) so I
shouldn't lose any messages from the embedded to the remote broker.
I do realise that a failure of the process with the embedded broker
will lose any in-flight messages that haven't made it to the remote
broker, but for my application that risk is acceptable.
Let me know if that doesn't do what I expect.

Thanks for the help.
Joe

On 30 November 2011 16:25, Gary Tully <ga...@gmail.com> wrote:
> the typical activemq way to do that is use an embeded vm broker and a
> network connector to forward messages to the target when it can.
> Disable persistence and it will use a memory store so it will be have
> like a buffer.
>
> On 29 November 2011 16:27, Joe Carter <jo...@gmail.com> wrote:
>> Hi,
>>
>> Does anyone know how to configure the connection factory so that it
>> will buffer messages while there's a temporary outage to the broker?
>> Basically the same as the "Buffered JMS client" in the IBM MQ product
>> http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
>> At the moment my application receives exceptions until the connection
>> recovers and I can't afford to block (its a soft real time app).
>> If not I'll write my own wrapper but I'd be surprised if there's not
>> one out there already.
>>
>> Thanks
>> Joe
>
>
>
> --
> http://fusesource.com
> http://blog.garytully.com

Re: Buffering producer messages

Posted by Gary Tully <ga...@gmail.com>.
the typical activemq way to do that is use an embeded vm broker and a
network connector to forward messages to the target when it can.
Disable persistence and it will use a memory store so it will be have
like a buffer.

On 29 November 2011 16:27, Joe Carter <jo...@gmail.com> wrote:
> Hi,
>
> Does anyone know how to configure the connection factory so that it
> will buffer messages while there's a temporary outage to the broker?
> Basically the same as the "Buffered JMS client" in the IBM MQ product
> http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
> At the moment my application receives exceptions until the connection
> recovers and I can't afford to block (its a soft real time app).
> If not I'll write my own wrapper but I'd be surprised if there's not
> one out there already.
>
> Thanks
> Joe



-- 
http://fusesource.com
http://blog.garytully.com

Reply:Buffering producer messages

Posted by SuoNayi <su...@163.com>.
For AMQ there is no Buffered JMS Client like IBM MQ product.
this says you cannot send messages or are blocked when the connection is broken.

For failoverTransport, enabling trackMessages will keep messages sent in memory and replay them if connection recovers from broken.
See http://activemq.apache.org/failover-transport-reference.html


At 2011-11-30 00:27:26,"Joe Carter" <jo...@gmail.com> wrote:
>Hi,
>
>Does anyone know how to configure the connection factory so that it
>will buffer messages while there's a temporary outage to the broker?
>Basically the same as the "Buffered JMS client" in the IBM MQ product
>http://www-10.lotus.com/ldd/lewiki.nsf/dx/01022009113953AMBJANPR.htm
>At the moment my application receives exceptions until the connection
>recovers and I can't afford to block (its a soft real time app).
>If not I'll write my own wrapper but I'd be surprised if there's not
>one out there already.
>
>Thanks
>Joe