Table 19–1 lists the connection factory attributes for connection handling.
Table 19–1 Connection Factory Attributes for Connection Handling
Attribute |
Type |
Default Value |
Description |
---|---|---|---|
String |
An existing Message Queue 3.0 address, if any; if none, the first entry in Table 19–2 |
List of broker addresses The list consists of one or more addresses, separated by commas. Each address specifies (or implies) the host name, port number, and connection service for a broker instance to which the client can connect. Address syntax varies depending on the connection service and port assignment method; see below for details. Literal IP addresses as host names: You can use a literal IPv4 or IPv6 address as a host name. If you use a literal IPv6 address, its format must conform to RFC2732, Format for Literal IPv6 Addresses in URL's. Note – In an enhanced broker cluster, the value of this attribute is updated dynamically as brokers enter and leave the cluster, so that it always reflects the cluster’s current membership. |
|
String |
PRIORITY |
Order in which to attempt connection to broker addresses: PRIORITY: Order specified in address list RANDOM: Random order Note – If many clients share the same connection factory, specify random connection order to prevent them from all attempting to connect to the same address. |
|
Integer |
1 |
Number of times to iterate through address list attempting to establish or reestablish a connection A value of -1 denotes an unlimited number of iterations. Note – In the event of broker failure in an enhanced broker cluster, this attribute is ignored and the Message Queue client runtime iterates through the address list indefinitely until it succeeds in reconnecting to a takeover broker. The effect is equivalent to an imqAddressListIterations value of -1, overriding any other explicit or default setting of this attribute. The only way for a client application to avoid this behavior is to close the connection explicitly on broker failure. |
|
imqPingInterval |
Integer |
30 |
Interval, in seconds, at which to test connection between client and broker A value of 0 or -1 disables periodic testing of the connection. |
Boolean |
false |
Attempt to reestablish a lost connection? Note – In the event of broker failure in an enhanced broker cluster, this attribute is ignored and automatic reconnection is always attempted. The effect is equivalent to an imqReconnectEnabled value of true, overriding any other explicit or default setting of this attribute. The only way for a client application to avoid this behavior is to close the connection explicitly on broker failure. |
|
Integer |
0 |
Number of times to attempt connection (or reconnection) to each address in address list before moving on to next A value of -1 denotes an unlimited number of connection attempts: attempt repeatedly to connect to first address until successful. For example, in an enhanced broker cluster, this value will allow for connection to the failover broker. |
|
Long integer |
3000 |
Interval, in milliseconds, between reconnection attempts This value applies both for successive attempts on a given address and for successive addresses in the list. Note – Too small a value may give the broker insufficient recovery time; too large a value may cause unacceptable connection delays. |
|
Boolean |
false |
Trust any certificate presented by broker? If false, the Message Queue client runtime will validate all certificates presented to it. Validation will fail if the signer of the certificate is not in the client's trust store. If true, validation of certificates is skipped. This can be useful, for instance, during software testing when a self-signed certificate is used. NOTE: To use signed certificates from a certification authority, set this attribute to false. |
The value of the imqAddressList attribute is a comma-separated string specifying one or more broker addresses to which to connect. The general syntax for each address is as follows:
scheme://address
where scheme identifies one of the addressing schemes shown in the first column of Table 19–2 and address denotes the broker address itself. The exact syntax for specifying the address depends on the addressing scheme, as shown in the last column of the table.
Table 19–2 Message Broker Addressing Schemes
Scheme |
Service |
Syntax |
Description |
---|---|---|---|
mq |
jms or ssljms |
[hostName][:portNumber][/serviceName] |
Assign port dynamically for jms or ssljms connection service The address list entry specifies the host name and port number for the Message Queue Port Mapper. The Port Mapper itself dynamically assigns a port to be used for the connection. Default values: hostName = localhost portNumber = 7676 serviceName = jms For the ssljms connection service, all variables must be specified explicitly. Literal IP addresses as host names: You can use a literal IPv4 or IPv6 address as a host name. If you use a literal IPv6 address, its format must conform to RFC2732, Format for Literal IPv6 Addresses in URL's. |
mqtcp |
jms |
hostName:portNumber/jms |
Connect to specified port using jms connection service Bypasses the Port Mapper and makes a TCP connection directly to the specified host name and port number. |
mqssl |
ssljms |
hostName:portNumber/ssljms |
Connect to specified port using ssljms connection service Bypasses the Port Mapper and makes a secure SSL connection directly to the specified host name and port number. |
http |
httpjms |
http://hostName:portNumber/contextRoot/tunnel If multiple broker instances use the same tunnel servlet, the following syntax connects to a specific broker instance rather than a randomly selected one: http://hostName:portNumber/contextRoot/tunnel? ServerName=hostName:instanceName |
Connect to specified port using httpjms connection service Makes an HTTP connection to a Message Queue tunnel servlet at the specified URL. The broker must be configured to access the HTTP tunnel servlet. |
https |
httpsjms |
https://hostName:portNumber/contextRoot/tunnel If multiple broker instances use the same tunnel servlet, the following syntax connects to a specific broker instance rather than a randomly selected one: https://hostName:portNumber/contextRoot/tunnel? ServerName=hostName:instanceName |
Connect to specified port using httpsjms connection service Makes a secure HTTPS connection to a Message Queue tunnel servlet at the specified URL. The broker must be configured to access the HTTPS tunnel servlet. |
Table 19–3 Message Broker Address Examples
Service |
Broker Host |
Port |
Example Address |
---|---|---|---|
Not specified |
Not specified |
Not specified |
No address (mq://localHost:7676/jms) |
Not specified |
Specified host |
Not specified |
myBkrHost (mq://myBkrHost:7676/jms) |
Not specified |
Not specified |
Specified Port Mapper port |
1012 (mq://localHost:1012/jms) |
ssljms |
Local host |
Standard Port Mapper port |
mq://localHost:7676/ssljms |
ssljms |
Specified host |
Standard Port Mapper port |
mq://myBkrHost:7676/ssljms |
ssljms |
Specified host |
Specified Port Mapper port |
mq://myBkrHost:1012/ssljms |
jms |
Local host |
Specified service port |
mqtcp://localhost:1032/jms |
ssljms |
Specified host |
Specified service port |
mqssl://myBkrHost:1034/ssljms |
httpjms |
Not applicable |
Not applicable |
http://websrvr1:8085/imq/tunnel |
httpsjms |
Not applicable |
Not applicable |
https://websrvr2:8090/imq/tunnel |