git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: connections


On 09/06/2018 05:35 PM, developer wrote:
Hi,
Could anyone correct me if I am doing anything wrong here.


  p= new ActiveMQConnectionFactory() ;
  connection1 = p->createConnection(xy,yz);
  connection1->start();


  q= new ActiveMQConnectionFactory() ;
  connection2 = q->createConnection(xy,yz);
  connection2->start();

  r= new ActiveMQConnectionFactory() ;
  connection3 = r->createConnection(xy,yz);
  connection3->start();

send and recv messages

The cable is unplugged for some time which breaks the communication and
close function is called.
  connection1->close();
  connection2->close();
  connection3->start();

after certain delay i try to reestablish connection in code as below

  p1= new ActiveMQConnectionFactory() ;
  connection4 = p1->createConnection(xy,yz);
  connection4->start();


  q1= new ActiveMQConnectionFactory() ;
  connection5 = q1->createConnection(xy,yz);
  connection5->start();

Cable is plugged back so communication should be established but the issue
here is I end up in
exception in
void IOTransport::fire(decaf::lang::Exception& ex)

with error message An unspecified error has occurred.

I am not using failover and have these setting in tcp broker
connnection.closeTimeout=100&wireFormat.maxInactivityDurationInitalDelay=3000

Can i do this? what is that i am doing wrong? what is best way to fix this?




--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

It's unclear from your message where the exception is thrown but it'd be normal for any of the methods of Connection, Session, Producer or Consumer to throw an exception once you've broken the connection and the connection checker thread fired and saw it or the socket level error trickled out to the IOTransport as it appears may have happened here.

--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/