activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Dumontier <m...@mdumontier.com>
Subject Re: ForwardingBridge - how do i do it?
Date Thu, 26 Oct 2006 14:35:18 GMT
Hi,

 From what i can tell this is what is happening

CASE 1
------------
1.start remote broker
2.start up client with embedded broker (local broker)
3.start sending messages

Up to here, all is working well...messages are immediately forwarded to 
remote broker

4. kill remote broker

Messages are queuing up in local broker as expected

5. start up remote broker

Messages continue to queue up in local broker...no reconnection occurs



CASE 2
------------
1. start up remote broker
2. start up client (currently has queued messages in local broker)

messages are sent to remote broker, *but* queued messages in local 
broker don't get forwarded



Case 3
-----------
1. start up client

ConnectionRefused exception occurs. What I'd like to see is for the 
client to keep trying to connect to the remote broker with no exception 
thrown. what is the best pattern (or URI parameter?) to achieve this.


Thanks Again,
Marc







Marc Dumontier wrote:

> From the ForwardingBridgeTest, I kind of put this together 
> quickly...seems to work so far..need to do testing though
> let me know if this is the right path
>
>        BrokerService brokerBean = (BrokerService)ctx.getBean("broker");
>        try {                      URI localUri = new 
> URI("vm://localhost");
>            Transport localTransport = TransportFactory.connect(localUri);
>                      URI remoteUri = new URI("tcp://localhost:61616");
>            Transport remoteTransport = 
> TransportFactory.connect(remoteUri);
>                      ForwardingBridge bridge = new 
> ForwardingBridge(localTransport,remoteTransport);
>                      bridge.setClientId("local-remote-bridge");
>            bridge.setDispatchAsync(false);
>            bridge.start();
>
>                     Thread.sleep(1000);
>            
>        }catch(Exception e) {
>            log.error(e);
>        }
>
>
>
> Marc Dumontier wrote:
>
>> Hi,
>>
>> I had asked this question a while back but never got any 
>> responses...I still really need to figure out how to do this in order 
>> to use the product. Hopefully someone can send me in the right direction
>>
>> currently, when using spring based config, i can create a network 
>> connector like
>>
>>    <networkConnectors>
>>        <networkConnector uri="static:(tcp://localhost:61616)" 
>> failover="true"/>
>>    </networkConnectors>
>>
>>
>> From the documentation, I gather this creates a 
>> DemandForwardingBridge - meaning that messages are stored on the 
>> local broker until a consumer (connected to the remote broker) polls 
>> for it or something (store-and-forward?). That's my understanding 
>> anyway.
>>
>> What I need is the ForwardingBridge where messages will be forwarded 
>> immediately from the local broker to the remote broker regardless of 
>> anything else. If the remote broker isn't available, then the local 
>> broker would hang on to the message until the remote broker is 
>> available once again. when the connection is re-established, all 
>> messages queued up on the local broker is forwarded immediately.
>>
>> Can anyone help me configure this behavior? Can I do it using spring 
>> config..or do i have to create and link the objects in code? btw:I'm 
>> using 4.0
>>
>> Thanks,
>>
>> Marc Dumontier
>>
>>
>>
>>
>>
>>
>>
>


Mime
View raw message