Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fault Tolerance JMS URL in Java

I am doing a JMS connection using Java. The command I am using to establish connection is

QueueConnectionFactory factory = 
  new com.tibco.tibjms.TibjmsQueueConnectionFactory(JMSserverUrl);

Where JMSServerUrl is the varible which stores my JMS URL.

Now the problem is that I need to add the fault tolerance URL i.e two different URL's. So can any one tell me how can I specify two URLs together in the above code sample such that if first URL is not accessible it should try connecting to the other URL.

like image 697
Kapil Avatar asked Jun 26 '26 07:06

Kapil


1 Answers

Put all URLs in a single string with a comma between them.

new TibjmsQueueConnectionFactory("ssl://host01:20302,ssl://host02:20302");

Caution, I am a Tibco EMS newbie, but this seems to work, as evidenced by the error I can get ...

javax.jms.JMSSecurityException: Failed to connect to any server at:
ssl://host01:20302,ssl://host02:20302 
[Error: Can not initialize SSL client: no trusted certificates are set: 
url that returned this exception = SSL://host01:20302 ]
like image 121
Synesso Avatar answered Jun 29 '26 12:06

Synesso



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!