How to check if MQ is connected

RLe

I'm trying to connect to my MQ servers. I have 2 MQ Server: server 1 and server 2 and set it as connectionNameList for mqConnectionFactory. Is there a way for MQ to connect to server 1 if server 2 failed? How can I know if MQ server is connected? I saw that there is clientReconnectOptions set to 67108864 but I'm not sure what is that.

JoshMc

The possible settings for ClientReconnectOptions are documented in the IBM MQ Knowledge center page CLIENTRECONNECTOPTIONS

Below is an example using setClientReconnectOptions to set it so the application can reconnect to any queue manager listing on the two host(port) combinations set in the connectionNameList.

MQQueueConnectionFactory factory = new MQQueueConnectionFactory();

factory.setQueueManager("QMNAME");
factory.setChannel("SVRCONN.CHL");
factory.setConnectionNameList("hostName1(port),hostName2(port)");
factory.setClientReconnectOptions( WMQConstants.WMQ_CLIENT_RECONNECT );

// Set the amount of time you will attempt to reconnect in seconds
factory.setClientReconnectTimeout( 43200 ); //12 hours
//default is 1800 seconds
//factory.setClientReconnectTimeout(WMQConstants.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);

Note that clients will not always attempt to reconnect, see the following from the endmqm man page on Linux:

If you issue endmqm to stop a queue manager, reconnectable clients do not try to reconnect. To override this behavior, specify either the -r or -s option to enable clients to start trying to reconnect.

Note: If a queue manager or a channel ends unexpectedly, reconnectable clients start trying to reconnect.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to reliably detect if an external keyboard is connected on iOS 9?

分類Dev

Connected vertices from polygon, how to get the new polygons

分類Dev

How to count all the connected nodes (rows) in a graph on Postgres?

分類Dev

How to get all MAC addresses connected to WiFi with node.js?

分類Dev

how to shape tensor from fully connected to to 4-D

分類Dev

netlogo: how to get nodes that are connected with a link to a node N

分類Dev

TightVNC: How to list all connected users

分類Dev

How are these nested vectors connected?

分類Dev

In Altair, how to set the size of the connected points in a line chart?

分類Dev

How to view that Advertiser is connected

分類Dev

How does a (2 or 3) dimensional Fully connected layer work?

分類Dev

Regex: How to ignore dots in connected words

分類Dev

How does an AWS IoT device show as "connected"

分類Dev

How can I tell through the Stripe API if a connected account is complete?

分類Dev

How can a JavaScript app detect if a Leap Motion device is connected

分類Dev

How do I turn off WLAN automatically when LAN is connected?

分類Dev

How to get only Websphere MQ messages with a particular priority in C#?

分類Dev

How to authenticate Facebook User after receiving response.status === 'connected'?

分類Dev

How to drop a Redshfit database with connected users

分類Dev

How is async interface connected to GWT.create?

分類Dev

How to use AMQP with Active MQ in Mule

分類Dev

How to integrate rabbit mq client library

分類Dev

How to detect click event of connected Bluetooth peripheral device (Selfie stick)?

分類Dev

How to check if a Windows 8.1 PC ever connected to the Internet?

分類Dev

How can I see my LAN when connected to a VPN?

分類Dev

How to detect if Chromecast is already connected on Android Sender?

分類Dev

How detect the devices connected to wif network

分類Dev

How to select the mq-deadline scheduler?

分類Dev

mvc signalr how to display all connected users

Related 関連記事

  1. 1

    How to reliably detect if an external keyboard is connected on iOS 9?

  2. 2

    Connected vertices from polygon, how to get the new polygons

  3. 3

    How to count all the connected nodes (rows) in a graph on Postgres?

  4. 4

    How to get all MAC addresses connected to WiFi with node.js?

  5. 5

    how to shape tensor from fully connected to to 4-D

  6. 6

    netlogo: how to get nodes that are connected with a link to a node N

  7. 7

    TightVNC: How to list all connected users

  8. 8

    How are these nested vectors connected?

  9. 9

    In Altair, how to set the size of the connected points in a line chart?

  10. 10

    How to view that Advertiser is connected

  11. 11

    How does a (2 or 3) dimensional Fully connected layer work?

  12. 12

    Regex: How to ignore dots in connected words

  13. 13

    How does an AWS IoT device show as "connected"

  14. 14

    How can I tell through the Stripe API if a connected account is complete?

  15. 15

    How can a JavaScript app detect if a Leap Motion device is connected

  16. 16

    How do I turn off WLAN automatically when LAN is connected?

  17. 17

    How to get only Websphere MQ messages with a particular priority in C#?

  18. 18

    How to authenticate Facebook User after receiving response.status === 'connected'?

  19. 19

    How to drop a Redshfit database with connected users

  20. 20

    How is async interface connected to GWT.create?

  21. 21

    How to use AMQP with Active MQ in Mule

  22. 22

    How to integrate rabbit mq client library

  23. 23

    How to detect click event of connected Bluetooth peripheral device (Selfie stick)?

  24. 24

    How to check if a Windows 8.1 PC ever connected to the Internet?

  25. 25

    How can I see my LAN when connected to a VPN?

  26. 26

    How to detect if Chromecast is already connected on Android Sender?

  27. 27

    How detect the devices connected to wif network

  28. 28

    How to select the mq-deadline scheduler?

  29. 29

    mvc signalr how to display all connected users

ホットタグ

アーカイブ