Class Tibjms

  • java.lang.Object
    • com.tibco.tibjms.Tibjms

  • public class Tibjms
    extends java.lang.Object
    Defines optional custom methods, constants and System Properties used by TIBCO Enterprise Message Service client.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_FACTORY_PASSWORD
      Defines the name of the ConnectionFactory property specifying default user password set for Connections created by the factory.
      static java.lang.String DEFAULT_FACTORY_USERNAME
      Defines the name of the ConnectionFactory property specifying default user name set for Connections created by the factory.
      static int EXPLICIT_CLIENT_ACKNOWLEDGE
      Defines explicit client acknowledge mode.
      static int EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
      Defines explicit client acknowledge mode with dups_ok.
      static java.lang.String FACTORY_CONNECT_ATTEMPT_COUNT
      Defines the name of the ConnectionFactory property specifying the maximum iterations a client program will go through its URL list until it establishes its first connection to an EMS server.
      static java.lang.String FACTORY_CONNECT_ATTEMPT_DELAY
      Defines the name of the ConnectionFactory property specifying the interval between iterations a client program will try to establish its first connection to an EMS server.
      static java.lang.String FACTORY_CONNECT_ATTEMPT_TIMEOUT
      Defines the name of the ConnectionFactory property specifying the maximum amount of time a client program will wait for the connection to be established to an EMS server

      This property is defined as String "com.tibco.tibjms.connect.attempttimeout".
      static java.lang.String FACTORY_LOAD_BALANCE_METRIC
      Defines the name of the ConnectionFactory property specifying the metric to be used for load balancing by the factory.
      static int FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE
      Indicates that the connection factory load balances connections across multiple servers by creating a connection to the server with the lowest total byte rate (input and output).
      static int FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS
      Indicates that the connection factory load balances connections across multiple servers by creating a connection to the server with the fewest number of connections.
      static int FACTORY_LOAD_BALANCE_METRIC_NONE
      Indicates that no load balancing metric has been set for the connection factory.
      static java.lang.String FACTORY_MULTICAST_DAEMON
      Deprecated.
      As of release 8.3
      static java.lang.String FACTORY_MULTICAST_ENABLED
      Deprecated.
      As of release 8.3
      static java.lang.String FACTORY_RECONNECT_ATTEMPT_COUNT
      Defines the name of the ConnectionFactory property specifying the maximum iterations a client program will try to re-establish a connection to an EMS server after losing previous connection.
      static java.lang.String FACTORY_RECONNECT_ATTEMPT_DELAY
      Defines the name of the ConnectionFactory property specifying the interval between reconnection attempts.
      static java.lang.String FACTORY_RECONNECT_ATTEMPT_TIMEOUT
      Defines the name of the ConnectionFactory property specifying the maximum amount of time a client program will wait for the connection to be re-established to an EMS server.
      static java.lang.String JMS_TIBCO_CM_PUBLISHER
      Provider specific message property which may be set if imported message has been published by TIBCO Rendezvous Certified Messaging application.
      static java.lang.String JMS_TIBCO_CM_SEQUENCE
      Provider specific message property which may be set if imported message has been published by TIBCO Rendezvous Certified Messaging application.
      static java.lang.String JMS_TIBCO_COMPRESS
      Provider specific message property which is set by the application if this message should be compressed before it is sent to the server.
      static java.lang.String JMS_TIBCO_DISABLE_SENDER
      Provider specific message property which may be set to prevent the server from including the user name into message when sending this message to consumers.
      static java.lang.String JMS_TIBCO_IMPORTED
      Provider specific message property which is set by the provider if the message has been imported from TIBCO Rendezvous or TIBCO FTL.
      static java.lang.String JMS_TIBCO_MSG_EXT
      Provider specific message property which is set by the provider or the application when message extensions are used.
      static java.lang.String JMS_TIBCO_MSG_TRACE
      Provider specific message property which can be set by the application if this message should be traced in the server and optionally in the client.
      static java.lang.String JMS_TIBCO_PRESERVE_UNDELIVERED
      Provider specific message property which is set by the application if this message should be placed into special system queue in case it could not be delivered.
      static java.lang.String JMS_TIBCO_SENDER
      Provider specific message property which may be set in a received message if message has been sent on a destination with sender name property.
      static java.lang.String JMS_TIBCO_SS_SENDER
      Deprecated.
      As of release 8.6
      static int NO_ACKNOWLEDGE
      Defines no acknowledge acknowledge mode.
      static int NPSEND_CHECK_ALWAYS
      Defines mode when producer always checks result of sending a NON_PERSISTENT message.
      static int NPSEND_CHECK_AUTH
      Defines mode when producer checks result of sending a NON_PERSISTENT message only when server authorization is enabled.
      static int NPSEND_CHECK_DEFAULT
      Defines default check mode for sending a NON_PERSISTENT messages.
      static int NPSEND_CHECK_NEVER
      Defines mode when producer never checks result of sending a NON_PERSISTENT message.
      static int NPSEND_CHECK_TEMP_AUTH
      Defines mode when producer checks result of sending a NON_PERSISTENT message when sending into temporary destination or if server authorization is enabled.
      static int NPSEND_CHECK_TEMP_DEST
      Defines mode when producer checks result of sending a NON_PERSISTENT message only when sending into temporary destination.
      static java.lang.String PROP_CLOSE_IN_CALLBACK
      Defines the name of the System Property controlling if the Session.close(), Connection.close(), Connection.stop(), JMSContext.close() or JMSContext.stop() methods can be called in the MessageListener callback.
      static java.lang.String PROP_CONNECT_ATTEMPT_TIMEOUT
      Defines the name of the System Property controlling the maximum time for the connections to connect to the server.
      static java.lang.String PROP_CONNECT_ATTEMPTS
      Defines the name of the System Property controlling the number of attempts the connections make to connect to the server.
      static java.lang.String PROP_DAEMON_DISPATCHER
      Defines the name of the System Property controlling the type of Session dispatcher threads.
      static java.lang.String PROP_FT_EVENTS_EXCEPTION
      Defines the name of the System Property controlling if ExceptionListener set on the Connection should be called for all the following events: disconnected, each reconnect attempt, and reconnected.
      static java.lang.String PROP_FT_SWITCH_EXCEPTION
      Defines the name of the System Property controlling if ExceptionListener set on the Connection should be called after fault-tolerant switch.
      static java.lang.String PROP_MESSAGE_ENCODING
      Defines the name of the System Property setting the global encoding name for String values in the message properties and data fields.
      static java.lang.String PROP_MULTICAST_DAEMON
      Deprecated.
      As of release 8.3
      static java.lang.String PROP_MULTICAST_ENABLED
      Deprecated.
      As of release 8.3
      static java.lang.String PROP_OAUTH2_ACCESS_TOKEN
      Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 access token that connections will use for all authentication attempts with the EMS server.
      static java.lang.String PROP_OAUTH2_CLIENT_ID
      Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 client ID to use when connecting to the OAuth 2.0 authorization server.
      static java.lang.String PROP_OAUTH2_CLIENT_SECRET
      Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 client secret to use when connecting to the OAuth 2.0 authorization server.
      static java.lang.String PROP_OAUTH2_DISABLE_VERIFY_HOSTNAME
      Defines the name of the ConnectionFactory property / System property specifying whether to disable client verification of the hostname in the secure OAuth 2.0 authorization server host's certificate.
      static java.lang.String PROP_OAUTH2_EXPECTED_HOSTNAME
      Defines the name of the ConnectionFactory property / System Property specifying the hostname expected to be set in the secure OAuth 2.0 authorization server host's certificate.
      static java.lang.String PROP_OAUTH2_SERVER_TRUST_FILE
      Defines the name of the ConnectionFactory property / System property specifying the path to a trust file for verifying the identity of the secure OAuth 2.0 authorization server.
      static java.lang.String PROP_OAUTH2_SERVER_URL
      Defines the name of the ConnectionFactory property / System Property specifying the HTTP or HTTPS URL of the OAuth 2.0 authorization server that will issue the OAuth 2.0 access tokens.
      static java.lang.String PROP_OAUTH2_TOKEN_FETCH_CALLBACK_OBJECT
      Defines the name of the ConnectionFactory property specifying the object whose onOAuth2TokenFetchRequest method will be invoked whenever a connection needs to acquire an OAuth 2.0 access token.
      static java.lang.String PROP_PING_INTERVAL
      Defines the name of the System Property setting the ping interval for inactive connections.
      static java.lang.String PROP_RECONNECT_ATTEMPT_TIMEOUT
      Defines the name of the System Property controlling the maximum time for connections to reconnect to the backup server during the fault-tolerant switch.
      static java.lang.String PROP_RECONNECT_ATTEMPTS
      Defines the name of the System Property controlling the number of attempt the connections make to reconnect to the backup server during the fault-tolerant switch.
      static java.lang.String PROP_RESTORE_8_3_0_CONNECT_BEHAVIOR
      Starting with 8.4, the TibjmsUFOConnectionFactory class uses the connect/reconnect system properties to control its connections.
      static java.lang.String PROP_SOCKET_CONNECT_TIMEOUT
      Defines the name of the System Property controlling the low-level timeout of connecting the socket to the server.
      static java.lang.String PROP_SOCKET_RECEIVE
      Defines the name of the System Property setting the size of the socket receive buffer size in kilobytes for client connections.
      static java.lang.String PROP_SOCKET_SEND
      Defines the name of the System Property setting the size of the socket send buffer size in kilobytes for client connections.
      static java.lang.String PROP_SSL_DEBUG_TRACE
      Defines the name of the System Property specifying debug tracing for TLS connections.
      static java.lang.String PROP_SSL_TRACE
      Defines the name of the System Property specifying tracing for TLS connections.
      static java.lang.String PROP_TRACE_FILE
      Defines the name of the System Property specifying the trace file name to be used when client tracing is enabled.

      This property is defined as String "tibco.tibjms.trace.file".
      static java.lang.String PROP_TX_SEND_DEST_CHECK
      The send or publish methods of the JMSProducer, MessageProducer, QueueSender, and TopicPublisher classes that take a Destination parameter throw and an InvalidDestinationRuntimeException or an InvalidDestinationException if the destination is invalid, unless they participate in a transaction, in which case the exception is deferred to the XA.end or local transaction commit.
      static int RELIABLE_DELIVERY
      Defines reliable delivery mode.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static int calculateMessageSize​(Message msg)
      Calculates and returns total size of the message wire representation.
      static Message createFromBytes​(byte[] bytes)
      Create a message from specified byte array.
      static boolean getAllowCallbackInClose()
      Deprecated.
      This method has been misnamed and replaced by getAllowCloseInCallback.
      static boolean getAllowCloseInCallback()
      Returns if allowed to call close() in callbacks.
      static byte[] getAsBytes​(Message message)
      Return a copy of the message data as a byte array, suitable for archiving in a file.
      static java.lang.String getConnectAttempts()
      Returns the connect attempts setting.
      static int getConnectAttemptTimeout()
      Returns the connect attempt timeout value
      static java.lang.String getConnectionActiveURL​(Connection connection)
      Returns a string representing the URL of the server that this connection is currently connected to.
      static java.lang.String getConnectionActiveURL​(JMSContext context)
      Returns a string representing the URL of the server that the connection used by this context is currently connected to.
      static java.lang.String getEncoding()
      Retursn global string encoding for messages.
      static boolean getExceptionOnFTEvents()
      Returns if exception listener is called on FT events (disconnected, reconnect attempt, and reconnected)
      static boolean getExceptionOnFTSwitch()
      Returns if exception listener is called on FT switch.
      static int getMessageBodySize​(Message msg)
      Returns the total wire size of the message body for a message which was received or sent.
      static java.lang.String getMessageEncoding​(Message message)
      Returns string encoding name set for this message.
      static int getMessageHeadersSize​(Message msg)
      Returns the total wire size of the message headers for a message which was received or sent.
      static int getMessagePropertiesSize​(Message msg)
      Returns the total wire size of the message properties for a message which was received or sent.
      static int getMessageSize​(Message msg)
      Returns the total wire size of the message which was received or sent.
      static java.lang.String getMulticastDaemon()
      Deprecated.
      As of release 8.3
      static boolean getMulticastEnabled()
      Deprecated.
      As of release 8.3
      static int getNPSendCheckMode​(JMSProducer producer)
      Returns the mode defining when a producer checks the result of sending a NON_PERSISTENT message.
      static int getNPSendCheckMode​(MessageProducer producer)
      Returns the mode defining when a producer checks the result of sending a NON_PERSISTENT message.
      static int getPingInterval()
      Returns the ping interval in seconds used by inactive connections.
      static java.lang.String getReconnectAttempts()
      Returns the reconnect attempts setting.
      static int getReconnectAttemptTimeout()
      Returns the reconnect attempt timeout value
      static boolean getSessionDispatcherDaemon()
      Returns if session dispatcher threads are daemon.
      static long getSocketConnectTimeout()
      Returns the timeout in milliseconds used by low-level socket connect calls.
      static int getSocketReceiveBufferSize()
      Returns the size of socket receive buffer.
      static int getSocketSendBufferSize()
      Returns the size of socket send buffer.
      static boolean isConsumerMulticast​(MessageConsumer consumer)
      Deprecated.
      As of release 8.3
      static void makeWriteable​(Message message)
      Set message to writeable state without resetting its content.
      static void recoverMsg​(Message msg)
      Recover a single message.
      static void setAllowCallbackInClose​(boolean allow)
      Deprecated.
      This method has been misnamed and replaced by setAllowCloseInCallback.
      static void setAllowCloseInCallback​(boolean allow)
      Sets if the Session.close(), Connection.close(), Connection.stop(), JMSContext.close() or JMSContext.stop() methods can be called in the MessageListener callback.
      static void setConnectAttempts​(java.lang.String specs)
      Sets the parameters for the number of attempts the connections make to connect to the server.
      static void setConnectAttemptTimeout​(int timeout)
      Sets the parameter for the maxmimum amount of time a client will wait for the connection to be established.
      static void setEncoding​(java.lang.String encodingName)
      Set global string encoding for messages.
      static void setExceptionOnFTEvents​(boolean callExceptionListener)
      Sets if ExceptionListener set on the Connection should be called for all the following events: disconnected, each reconnect attempt, and reconnected.
      static void setExceptionOnFTSwitch​(boolean callExceptionListener)
      Sets if ExceptionListener set on the Connection should be called after fault-tolerant switch.
      static void setMessageEncoding​(Message message, java.lang.String encodingName)
      Set string encoding for message.
      static void setMulticastDaemon​(java.lang.String port)
      Deprecated.
      As of release 8.3
      static void setMulticastEnabled​(boolean enabled)
      Deprecated.
      As of release 8.3
      static void setMulticastExceptionListener​(TibjmsMulticastExceptionListener listener)
      Deprecated.
      As of release 8.3
      static void setNPSendCheckMode​(JMSProducer producer, int mode)
      Set the mode defining when a producer should check the result of sending a NON_PERSISTENT message.
      static void setNPSendCheckMode​(MessageProducer producer, int mode)
      Set the mode defining when a producer should check the result of sending a NON_PERSISTENT message.
      static void setPingInterval​(int seconds)
      Sets the ping interval in seconds used by inactive connections.
      static void setReconnectAttempts​(java.lang.String specs)
      Sets the parameter for the number of attempts the connections make to reconnect to the backup server during fault-tolerant switch.
      static void setReconnectAttemptTimeout​(int timeout)
      Sets the parameter for the maxmimum amount of time a client will wait for the reconnect to complete.
      static void setSessionDispatcherDaemon​(boolean makeDaemon)
      Sets if Session dispatcher threads should be daemon.
      static void setSocketConnectTimeout​(long milliseconds)
      Sets the timeout in milliseconds used by low-level socket connect calls.
      static void setSocketReceiveBufferSize​(int size)
      Sets the size of the socket receive buffer size for client connections.
      static void setSocketSendBufferSize​(int size)
      Sets the size of the socket send buffer size for client connections.
      static void setTraceFile​(java.lang.String fileName)
      Use this method to instruct the TIBCO EMS Client library to direct the tracing, that would normally go to stderr or stdout, to a file named fileName.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RELIABLE_DELIVERY

        public static final int RELIABLE_DELIVERY
        Defines reliable delivery mode. This delivery mode is a proprietary extension and when used offers increased performance of the message producers using this mode.
        This is defined as an integer value 22.
        See Also:
        Constant Field Values
      • NO_ACKNOWLEDGE

        public static final int NO_ACKNOWLEDGE
        Defines no acknowledge acknowledge mode. This acknowledge mode is a proprietary extension and when used offers increased performance of the message consumers. Messages delivered to the sessions using this acknowledge mode do not require acknowledgement and are never redelivered regardless if the delivery has been successfull or not.
        This is defined as an integer value 22.
        See Also:
        Constant Field Values
      • EXPLICIT_CLIENT_ACKNOWLEDGE

        public static final int EXPLICIT_CLIENT_ACKNOWLEDGE
        Defines explicit client acknowledge mode. This acknowledge mode is a proprietary extension. Sessions using this acknowledge mode must acknowledge each message explicitly calling the acknowledge() method for all messages. The application can call aknowledge() in any order. The general rule that acknowledging a message will acknowledge all previous messages does not apply.
        This is defined as an integer value 23.
        See Also:
        Constant Field Values
      • EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE

        public static final int EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
        Defines explicit client acknowledge mode with dups_ok. This acknowledge mode is a proprietary extension. This acknowledge mode implements the same explicit acknowledge logic as the EXPLICIT_CLIENT_ACKNOWLEDGE mode. However while EXPLICIT_CLIENT_ACKNOWLEDGE guarantees the success of the acknowledge operation upon return, this mode does not and, similarly to DUPS_OK_ACKNOWLEDGE mode, acknowledges message lazily with the possibility that some acknowledged messages may be redelivered. Like for EXPLICIT_CLIENT_ACKNOWLEDGE, this mode requires a EMS application to explicitly call acknowledge() method, in any order, for each message it wants to acknowledge.
        This is defined as an integer value 24.
        See Also:
        Constant Field Values
      • JMS_TIBCO_IMPORTED

        public static final java.lang.String JMS_TIBCO_IMPORTED
        Provider specific message property which is set by the provider if the message has been imported from TIBCO Rendezvous or TIBCO FTL.

        This property is defined as String "JMS_TIBCO_IMPORTED".
        See Also:
        Constant Field Values
      • JMS_TIBCO_SENDER

        public static final java.lang.String JMS_TIBCO_SENDER
        Provider specific message property which may be set in a received message if message has been sent on a destination with sender name property. When set in the message, the property value is a String specifying the name of the user who sent this message.

        This property is defined as String "JMS_TIBCO_SENDER".
        See Also:
        Constant Field Values
      • JMS_TIBCO_DISABLE_SENDER

        public static final java.lang.String JMS_TIBCO_DISABLE_SENDER
        Provider specific message property which may be set to prevent the server from including the user name into message when sending this message to consumers. This property is ignored by the server if the destination is specified to enforce the inclusion of the user name. This property, if used, must be set to boolean value 'true' by the message producer before sending the message.

        This property is defined as String "JMS_TIBCO_DISABLE_SENDER".
        See Also:
        Constant Field Values
      • JMS_TIBCO_SS_SENDER

        @Deprecated
        public static final java.lang.String JMS_TIBCO_SS_SENDER
        Deprecated.
        As of release 8.6
        Provider specific message property which is set if imported message has been published by TIBCO SmartSockets application. Property value is a String specifying the SmartSockets sender name.

        This property is defined as String "JMS_TIBCO_SS_SENDER".
        See Also:
        Constant Field Values
      • JMS_TIBCO_CM_PUBLISHER

        public static final java.lang.String JMS_TIBCO_CM_PUBLISHER
        Provider specific message property which may be set if imported message has been published by TIBCO Rendezvous Certified Messaging application. When set in the imported message, the property value is a String specifying the CM publisher name.

        This property is defined as String "JMS_TIBCO_CM_PUBLISHER".
        See Also:
        Constant Field Values
      • JMS_TIBCO_CM_SEQUENCE

        public static final java.lang.String JMS_TIBCO_CM_SEQUENCE
        Provider specific message property which may be set if imported message has been published by TIBCO Rendezvous Certified Messaging application. When set in the imported message, the property value is long number specifying the CM sequence number of the imported message.

        This property is defined as String "JMS_TIBCO_CM_SEQUENCE".
        See Also:
        Constant Field Values
      • JMS_TIBCO_MSG_EXT

        public static final java.lang.String JMS_TIBCO_MSG_EXT
        Provider specific message property which is set by the provider or the application when message extensions are used. Message extensions allow to include StreamMessage and MapMessage objects as well as arrays of primitive types as values into StreamMessage and MapMessage messages.

        This property is defined as String "JMS_TIBCO_MSG_EXT".
        See Also:
        Constant Field Values
      • JMS_TIBCO_MSG_TRACE

        public static final java.lang.String JMS_TIBCO_MSG_TRACE
        Provider specific message property which can be set by the application if this message should be traced in the server and optionally in the client. Value of this property can be an empty string or null, or a string "body" if message trace should print the message data fields.

        This property is defined as String "JMS_TIBCO_MSG_TRACE".
        See Also:
        Constant Field Values
      • JMS_TIBCO_COMPRESS

        public static final java.lang.String JMS_TIBCO_COMPRESS
        Provider specific message property which is set by the application if this message should be compressed before it is sent to the server.

        This property is defined as String "JMS_TIBCO_COMPRESS".
        See Also:
        Constant Field Values
      • JMS_TIBCO_PRESERVE_UNDELIVERED

        public static final java.lang.String JMS_TIBCO_PRESERVE_UNDELIVERED
        Provider specific message property which is set by the application if this message should be placed into special system queue in case it could not be delivered.

        This property is defined as String "JMS_TIBCO_PRESERVE_UNDELIVERED".
        See Also:
        Constant Field Values
      • PROP_MESSAGE_ENCODING

        public static final java.lang.String PROP_MESSAGE_ENCODING
        Defines the name of the System Property setting the global encoding name for String values in the message properties and data fields. This property is defined as String "tibco.tibjms.msg.encoding".
        See Also:
        Constant Field Values
      • PROP_SOCKET_RECEIVE

        public static final java.lang.String PROP_SOCKET_RECEIVE
        Defines the name of the System Property setting the size of the socket receive buffer size in kilobytes for client connections. The value of this property is a string encoding the number of kilobytes, e.g. "256". Some operating systems may ignore this setting.

        This property is defined as String "tibco.tibjms.socket.receive".
        See Also:
        Constant Field Values
      • PROP_SOCKET_SEND

        public static final java.lang.String PROP_SOCKET_SEND
        Defines the name of the System Property setting the size of the socket send buffer size in kilobytes for client connections. The value of this property is a string encoding the number of kilobytes, e.g. "256". Some operating systems may ignore this setting.

        This property is defined as String "tibco.tibjms.socket.send".
        See Also:
        Constant Field Values
      • PROP_DAEMON_DISPATCHER

        public static final java.lang.String PROP_DAEMON_DISPATCHER
        Defines the name of the System Property controlling the type of Session dispatcher threads. When EMS application uses message listeners, TIBCO Enterprise Message Service client creates internal dispatcher threads for each Session which has at least one asynchronous message consumer. By default those dispatcher threads are not set to be daemon threads. If this system property is defined then the Session dispatcher threads will be created as daemon threads.

        This property is defined as String "tibco.tibjms.daemon.dispatcher".
        See Also:
        Constant Field Values
      • PROP_FT_SWITCH_EXCEPTION

        public static final java.lang.String PROP_FT_SWITCH_EXCEPTION
        Defines the name of the System Property controlling if ExceptionListener set on the Connection should be called after fault-tolerant switch. When EMS application performs fault-tolerant switch it may notify the Connection's ExceptionListener by calling it with JMSException providing the information about fault-tolerant switch. If this property is set, the Connection's ExceptionListener is called with the JMSException which has the vendor error code (JMSException.getErrorCode()) set to the String in the form:
        FT-SWITCH: <new-server-url>
        An EMS application can recognize such calls by analyzing the error code in the passed JMSException and perform necessary actions. Notice that the ExceptionListener is called with the special JMSException only when fault-tolerant switch has been performed succesfully. In case the fault-tolerant switch has failed, the Connection's ExceptionListener will be called with regular JMSException (it will not have error code in the form 'FT-SWITCH: <new-server-url>') specifying that the connection to EMS Server has been terminated. Notice that if this property is not set then by default Connection's ExceptionListener is not called after a successfull fault-tolerant switch.

        This property is defined as String "tibco.tibjms.ft.switch.exception". NOTE: when the exception listener is called, the exception listener is not allowed to call any EMS method. To do so in this case risks a deadlock in the client.
        See Also:
        Constant Field Values
      • PROP_FT_EVENTS_EXCEPTION

        public static final java.lang.String PROP_FT_EVENTS_EXCEPTION
        Defines the name of the System Property controlling if ExceptionListener set on the Connection should be called for all the following events: disconnected, each reconnect attempt, and reconnected. Similarly to PROP_FT_SWITCH_EXCEPTION, if this property is set and if a Connection's ExceptionListener is set, (and the connection has FT urls), then all above events will trigger the call to the ExceptionListener.onException callback with a JMSException which has the vendor error code (JMSException.getErrorCode()) set to the String in the form:
        FT-SWITCH: event
        where event is:

        • Disconnected from server url, will attempt to reconnect
        • Reconnecting to next server url, attempt n out of m
        • Reconnected to server url

        An EMS application can recognize such calls by analyzing the error code in the passed JMSException and perform necessary actions. Notice that this property replaces the property Tibjms.PROP_FT_SWITCH_EXCEPTION, which means that if both are set, only one "reconnected" event will be passed to the ExceptionListener.onException callback (the one described above). We recommend that if Tibjms.PROP_FT_SWITCH_EXCEPTION was formerly used, and the user wishes to capture all FT events, this new property be used instead and the ExceptionListener.onException callback modified to handle these new vendor error codes.

        This property is defined as String "tibco.tibjms.ft.events.exception".

        NOTE: when the exception listener is called, the exception listener is not allowed to call any EMS method. To do so in this case risks a deadlock in the client.
        See Also:
        Constant Field Values
      • PROP_CLOSE_IN_CALLBACK

        public static final java.lang.String PROP_CLOSE_IN_CALLBACK
        Defines the name of the System Property controlling if the Session.close(), Connection.close(), Connection.stop(), JMSContext.close() or JMSContext.stop() methods can be called in the MessageListener callback. According to the Jakarta Messaging 2.0 specification, calling any of these methods must trigger an IllegalStateException or an IllegalStateRuntimeException. If this property is set then the close() or the stop() method can be called inside the callback and it will not throw an exception and will proceed without waiting for the same callback to return.

        This property is defined as String "tibco.tibjms.close.in.callback".
        See Also:
        Constant Field Values
      • PROP_SOCKET_CONNECT_TIMEOUT

        public static final java.lang.String PROP_SOCKET_CONNECT_TIMEOUT
        Defines the name of the System Property controlling the low-level timeout of connecting the socket to the server. This only used with Java version 1.4.0 or higher. Default value used is "3000".

        This property is defined as String "tibco.tibjms.socket.connect.timeout".
        See Also:
        Constant Field Values
      • PROP_CONNECT_ATTEMPTS

        public static final java.lang.String PROP_CONNECT_ATTEMPTS
        Defines the name of the System Property controlling the number of attempts the connections make to connect to the server. When too many clients connect to the same server, the server may not be able to accept all connections at the same time. This parameter specifies the number of attempts and delay between the attempt the connections perform in order to connect to the server. The value of this property is a String in the form "NN[,DELAY]" where NN is the number of attempts and DELAY is delay in milliseconds between the attempts. Minimum value of NN is 1, minimum value of DELAY is 250 milliseconds. Default value used is "2,500".

        This property is defined as String "tibco.tibjms.connect.attempts".
        See Also:
        Constant Field Values
      • PROP_RECONNECT_ATTEMPTS

        public static final java.lang.String PROP_RECONNECT_ATTEMPTS
        Defines the name of the System Property controlling the number of attempt the connections make to reconnect to the backup server during the fault-tolerant switch. This property is similar to PROP_CONNECT_ATTEMPTS. The difference is that it may be necessary to use different parameters during reconnect than during the initial connect. Initial connect of the clients to the server is normally distributed in time and there are less chances of the server exceeding its maximum accept queue. During fault-tolerant switch, all connected clients automatically try to reconnect to the backup server, approximately at the same time. When the number of connections is large, it may require more attempts to reconnect than the initial connect. The value of this property is a String in the form "NN[,DELAY]" where NN is the number of attempts and DELAY is delay in milliseconds between the attempts. Minimum value of NN is 1, minimum value of DELAY is 250 milliseconds. Default value used is "4,500".

        This property is defined as String "tibco.tibjms.reconnect.attempts".
        See Also:
        Constant Field Values
      • PROP_PING_INTERVAL

        public static final java.lang.String PROP_PING_INTERVAL
        Defines the name of the System Property setting the ping interval for inactive connections. When a connection does not send nor receives any data, it may not be able to detect network failure in certain situations. To avoid this, inactive connections periodically send "ping" messages to the server. Default interval is 60 seconds. In some cases it may take several intervals to detect network failure. The value of this property is a string encoding the ping interval in seconds, e.g. "60". Zero value disables ping messages.

        This property is defined as String "tibco.tibjms.ping.interval".
        See Also:
        Constant Field Values
      • PROP_CONNECT_ATTEMPT_TIMEOUT

        public static final java.lang.String PROP_CONNECT_ATTEMPT_TIMEOUT
        Defines the name of the System Property controlling the maximum time for the connections to connect to the server. When too many clients connect to the same server, the server may not be able to accept all connections at the same time or may run out of system resources. This parameter specifies the amount of time a client is willing to wait for a connection to be established. Internally the client library will tear down any hung connections (either because of non-availability of system resources or some other EMS server problem) after this timeout. The value of this property in an integer and is in milliseconds. This property is defined as String "tibco.tibjms.connect.attempt.timeout".
        See Also:
        Constant Field Values
      • PROP_RECONNECT_ATTEMPT_TIMEOUT

        public static final java.lang.String PROP_RECONNECT_ATTEMPT_TIMEOUT
        Defines the name of the System Property controlling the maximum time for connections to reconnect to the backup server during the fault-tolerant switch. This property is similar to PROP_CONNECT_ATTEMPTS_TIMEOUT. The difference is that it may be necessary to use different parameters during reconnect than during the initial connect. Initial connect of the clients to the server is normally distributed in time and there are less chances of the server exceeding its maximum accept queue. During fault-tolerant switch, all connected clients automatically try to reconnect to the backup server, approximately at the same time. When the number of connections is large, it may require more reconnect time to reconnect than the initial connect. The value of this property is an integer in milliseconds. This property is defined as String "tibco.tibjms.reconnect.attempt.timeout".
        See Also:
        Constant Field Values
      • PROP_RESTORE_8_3_0_CONNECT_BEHAVIOR

        public static final java.lang.String PROP_RESTORE_8_3_0_CONNECT_BEHAVIOR
        Starting with 8.4, the TibjmsUFOConnectionFactory class uses the connect/reconnect system properties to control its connections. Furthermore, it now directly controls the connect/reconnect behavior of the TibjmsConnectionFactory that it uses internally. In earlier versions, the connect/reconnect system properties directly affected the internal TibjmsConnectionFactory used by the TibjmsUFOConnectionFactory. This resulted in unexpected connection/reconnect behavior when using UFO. If need be, you can revert to the pre-8.4 behavior by setting PROP_RESTORE_8_3_0_CONNECT_BEHAVIOR to 'true'.

        This property is defined as String "tibco.tibems.ufo.restore.8.3.0.connect.behavior".
        Since:
        EMS 8.4
        See Also:
        Constant Field Values
      • PROP_SSL_TRACE

        public static final java.lang.String PROP_SSL_TRACE
        Defines the name of the System Property specifying tracing for TLS connections.

        This property is defined as String "tibco.tibjms.ssl.trace".
        See Also:
        Constant Field Values
      • PROP_SSL_DEBUG_TRACE

        public static final java.lang.String PROP_SSL_DEBUG_TRACE
        Defines the name of the System Property specifying debug tracing for TLS connections.

        This property is defined as String "tibco.tibjms.ssl.debug.trace".
        See Also:
        Constant Field Values
      • PROP_MULTICAST_ENABLED

        @Deprecated
        public static final java.lang.String PROP_MULTICAST_ENABLED
        Deprecated.
        As of release 8.3
        Defines the name of the System Property specifying whether multicast is enabled or disabled for this EMS client.

        This property is defined as String "tibco.tibjms.multicast.enabled".
        See Also:
        Constant Field Values
      • PROP_MULTICAST_DAEMON

        @Deprecated
        public static final java.lang.String PROP_MULTICAST_DAEMON
        Deprecated.
        As of release 8.3
        Defines the name of the System Property specifying the port on which EMS clients will connect to the multicast daemon.

        This property is defined as String "tibco.tibjms.multicast.daemon".
        See Also:
        Constant Field Values
      • PROP_TRACE_FILE

        public static final java.lang.String PROP_TRACE_FILE
        Defines the name of the System Property specifying the trace file name to be used when client tracing is enabled.

        This property is defined as String "tibco.tibjms.trace.file".
        See Also:
        Constant Field Values
      • DEFAULT_FACTORY_USERNAME

        public static final java.lang.String DEFAULT_FACTORY_USERNAME
        Defines the name of the ConnectionFactory property specifying default user name set for Connections created by the factory.

        This property is defined as String "com.tibco.tibjms.factory.username".
        See Also:
        Constant Field Values
      • DEFAULT_FACTORY_PASSWORD

        public static final java.lang.String DEFAULT_FACTORY_PASSWORD
        Defines the name of the ConnectionFactory property specifying default user password set for Connections created by the factory.

        This property is defined as String "com.tibco.tibjms.factory.password".
        See Also:
        Constant Field Values
      • FACTORY_LOAD_BALANCE_METRIC

        public static final java.lang.String FACTORY_LOAD_BALANCE_METRIC
        Defines the name of the ConnectionFactory property specifying the metric to be used for load balancing by the factory.

        This property is defined as String "com.tibco.tibjms.factory.metric".
        See Also:
        Constant Field Values
      • FACTORY_LOAD_BALANCE_METRIC_NONE

        public static final int FACTORY_LOAD_BALANCE_METRIC_NONE
        Indicates that no load balancing metric has been set for the connection factory.
        See Also:
        Constant Field Values
      • FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS

        public static final int FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS
        Indicates that the connection factory load balances connections across multiple servers by creating a connection to the server with the fewest number of connections.
        See Also:
        Constant Field Values
      • FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE

        public static final int FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE
        Indicates that the connection factory load balances connections across multiple servers by creating a connection to the server with the lowest total byte rate (input and output).
        See Also:
        Constant Field Values
      • FACTORY_CONNECT_ATTEMPT_COUNT

        public static final java.lang.String FACTORY_CONNECT_ATTEMPT_COUNT
        Defines the name of the ConnectionFactory property specifying the maximum iterations a client program will go through its URL list until it establishes its first connection to an EMS server.

        This property is defined as String "com.tibco.tibjms.connect.attemptcount"
        See Also:
        Constant Field Values
      • FACTORY_CONNECT_ATTEMPT_DELAY

        public static final java.lang.String FACTORY_CONNECT_ATTEMPT_DELAY
        Defines the name of the ConnectionFactory property specifying the interval between iterations a client program will try to establish its first connection to an EMS server.

        This property is defined as String "com.tibco.tibjms.connect.attemptdelay"
        See Also:
        Constant Field Values
      • FACTORY_CONNECT_ATTEMPT_TIMEOUT

        public static final java.lang.String FACTORY_CONNECT_ATTEMPT_TIMEOUT
        Defines the name of the ConnectionFactory property specifying the maximum amount of time a client program will wait for the connection to be established to an EMS server

        This property is defined as String "com.tibco.tibjms.connect.attempttimeout".
        See Also:
        Constant Field Values
      • FACTORY_RECONNECT_ATTEMPT_COUNT

        public static final java.lang.String FACTORY_RECONNECT_ATTEMPT_COUNT
        Defines the name of the ConnectionFactory property specifying the maximum iterations a client program will try to re-establish a connection to an EMS server after losing previous connection.

        This property is defined as String "com.tibco.tibjms.reconnect.attemptcount".
        See Also:
        Constant Field Values
      • FACTORY_RECONNECT_ATTEMPT_DELAY

        public static final java.lang.String FACTORY_RECONNECT_ATTEMPT_DELAY
        Defines the name of the ConnectionFactory property specifying the interval between reconnection attempts.

        This property is defined as String "com.tibco.tibjms.reconnect.attemptdelay".
        See Also:
        Constant Field Values
      • FACTORY_RECONNECT_ATTEMPT_TIMEOUT

        public static final java.lang.String FACTORY_RECONNECT_ATTEMPT_TIMEOUT
        Defines the name of the ConnectionFactory property specifying the maximum amount of time a client program will wait for the connection to be re-established to an EMS server.

        This property is defined as String "com.tibco.tibjms.reconnect.attempttimeout".
        See Also:
        Constant Field Values
      • PROP_OAUTH2_ACCESS_TOKEN

        public static final java.lang.String PROP_OAUTH2_ACCESS_TOKEN
        Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 access token that connections will use for all authentication attempts with the EMS server.

        NOTE: See TibjmsOAuth for an overview of OAuth 2.0 support in the client.

        If an access token is configured through this property, connections will always use that access token for authentication with the EMS server. Connections will not attempt to obtain access tokens using OAuth 2.0 grants (see PROP_OAUTH2_SERVER_URL) or user-defined callbacks (see PROP_OAUTH2_TOKEN_FETCH_CALLBACK_OBJECT).

        In the event of access token expiration, connections that use OAuth 2.0 grants or user-defined callbacks will automatically obtain a new access token and re-authenticate with the EMS server. However, connections that use a configured access token will not be able to handle this scenario and will experience authentication failures.

        This property is defined as String "com.tibco.tibjms.oauth2.access.token". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_ACCESS_TOKEN serves as an equivalent to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.access.token=access_token_string ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_SERVER_URL

        public static final java.lang.String PROP_OAUTH2_SERVER_URL
        Defines the name of the ConnectionFactory property / System Property specifying the HTTP or HTTPS URL of the OAuth 2.0 authorization server that will issue the OAuth 2.0 access tokens.

        NOTE: See TibjmsOAuth for an overview of OAuth 2.0 support in the client.

        When this property is set along with PROP_OAUTH2_CLIENT_ID and PROP_OAUTH2_CLIENT_SECRET, connections will automatically request access tokens from an OAuth 2.0 authorization server using OAuth 2.0 grants and use them to authenticate with the EMS server.

        Two OAuth 2.0 grant types are supported for obtaining access tokens in this manner: client credentials grant and resource owner password credentials grant. If the 'userName' parameter for the connection creation method is null, the client credentials grant is used. If the 'userName' parameter is not null, the resource owner password credentials grant is used, with the 'userName' and 'password' parameter values serving as the username and password credentials for the grant.

        Refresh tokens are supported when using the resource owner password credentials grant type. If the authorization server issues a refresh token along with the requested access token, the connection object will use that refresh token instead of the grant the next time it needs to request an access token. If it fails to obtain a new access token using the refresh token, it will try again using the grant.

        This property is defined as String "com.tibco.tibjms.oauth2.server.url". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_SERVER_URL serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.server.url=https://oauth2_server_url/token_endpoint ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_CLIENT_ID

        public static final java.lang.String PROP_OAUTH2_CLIENT_ID
        Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 client ID to use when connecting to the OAuth 2.0 authorization server.

        This property must be set along with PROP_OAUTH2_SERVER_URL and PROP_OAUTH2_CLIENT_SECRET in order to successfully request access tokens from an OAuth 2.0 authorization server using an OAuth 2.0 grant.

        This property is defined as String "com.tibco.tibjms.oauth2.client.id". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_CLIENT_ID serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.server.client.id=client_id_string ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_CLIENT_SECRET

        public static final java.lang.String PROP_OAUTH2_CLIENT_SECRET
        Defines the name of the ConnectionFactory property / System Property specifying the OAuth 2.0 client secret to use when connecting to the OAuth 2.0 authorization server.

        This property must be set along with PROP_OAUTH2_SERVER_URL and PROP_OAUTH2_CLIENT_ID in order to successfully request access tokens from an OAuth 2.0 authorization server using an OAuth 2.0 grant.

        This property is defined as String "com.tibco.tibjms.oauth2.client.secret". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_CLIENT_SECRET serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.client.secret=client_secret_string ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_TOKEN_FETCH_CALLBACK_OBJECT

        public static final java.lang.String PROP_OAUTH2_TOKEN_FETCH_CALLBACK_OBJECT
        Defines the name of the ConnectionFactory property specifying the object whose onOAuth2TokenFetchRequest method will be invoked whenever a connection needs to acquire an OAuth 2.0 access token.

        NOTE: See TibjmsOAuth for an overview of OAuth 2.0 support in the client.

        ConnectionFactory objects can be configured to create connections capable of directly contacting an OAuth 2.0 provider and requesting access tokens. If you wish to instead procure access tokens via an external mechanism and provide them directly to your connections, you can use this ConnectionFactory property to provide an instance of a class that implements the TibjmsOAuth2TokenFetchCallback interface. Connections created using the factory will invoke the onOAuth2TokenFetchRequest method from the instance whenever they require an access token for authentication.

        If this ConnectionFactory property is set, connections created using the factory will never attempt to request access tokens from an OAuth 2.0 authorization server using an OAuth 2.0 grant - even if the relevant OAuth 2.0 properties were set for the factory.

        If a ConnectionFactory object is configured with both an access token (see PROP_OAUTH2_ACCESS_TOKEN) and a user-defined callback, connections created using the factory will always use the access token for authentication.

        This property is defined as String "com.tibco.tibjms.oauth2.token.fetch.callback.object".

        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_SERVER_TRUST_FILE

        public static final java.lang.String PROP_OAUTH2_SERVER_TRUST_FILE
        Defines the name of the ConnectionFactory property / System property specifying the path to a trust file for verifying the identity of the secure OAuth 2.0 authorization server.

        The trust file set via this property must contain one or more PEM-encoded public certificates that will be used to validate the certificate presented by the secure OAuth 2.0 authorization server host.

        The trust file does not need to be set if connecting to an OAuth 2.0 authorization server with an HTTP URL.

        This property is defined as String "com.tibco.tibjms.oauth2.server.trust.file". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_SERVER_TRUST_FILE serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.server.trust.file=/path/to/trustfile ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_DISABLE_VERIFY_HOSTNAME

        public static final java.lang.String PROP_OAUTH2_DISABLE_VERIFY_HOSTNAME
        Defines the name of the ConnectionFactory property / System property specifying whether to disable client verification of the hostname in the secure OAuth 2.0 authorization server host's certificate.

        Unless this property is explicitly set to 'true', client verification of the host name in the secure OAuth 2.0 authorization server host's certificate is always performed by default.

        This property is defined as String "com.tibco.tibjms.oauth2.disable.verify.hostname". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_DISABLE_VERIFY_HOSTNAME serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.disable.verify.hostname=true ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • PROP_OAUTH2_EXPECTED_HOSTNAME

        public static final java.lang.String PROP_OAUTH2_EXPECTED_HOSTNAME
        Defines the name of the ConnectionFactory property / System Property specifying the hostname expected to be set in the secure OAuth 2.0 authorization server host's certificate.

        The expected host name set via this property is used to validate the actual host name found in the secure OAuth 2.0 authorization server host's certificate. If not set, the expected host name defaults to the name of the authorization server's host. This verification is only performed if host name verification has not been explicitly disabled by setting the PROP_OAUTH2_DISABLE_VERIFY_HOSTNAME property to 'true'.

        This property is defined as String "com.tibco.tibjms.oauth2.expected.hostname". If set as a ConnectionFactory property it applies to all connections created using that factory. If set as a System Property it applies to all connections created by the client library. The environment variable TIBEMS_OAUTH2_EXPECTED_HOSTNAME serves as an alternative to the System Property.

        System properties can be set programmatically, or by passing the -D option when starting the Java client application. For example,

         java -Dcom.tibco.tibjms.oauth2.expected.hostname=expected_hostname ...
         
        Since:
        EMS 10.3
        See Also:
        Constant Field Values
      • FACTORY_MULTICAST_ENABLED

        @Deprecated
        public static final java.lang.String FACTORY_MULTICAST_ENABLED
        Deprecated.
        As of release 8.3
        Defines the name of the ConnectionFactory property specifying whether MessageConsumers subscribed to a multicast-enabled topic are to receive messages over multicast.

        This property is defined as String "com.tibco.tibjms.multicast.enabled".
        See Also:
        Constant Field Values
      • FACTORY_MULTICAST_DAEMON

        @Deprecated
        public static final java.lang.String FACTORY_MULTICAST_DAEMON
        Deprecated.
        As of release 8.3
        Defines the name of the ConnectionFactory property specifying the port of the multicast daemon used by MessageConsumers subscribed to multicast-enabled topics.

        This property is defined as String "com.tibco.tibjms.multicast.daemon".
        See Also:
        Constant Field Values
    • Method Detail

      • getMessageSize

        public static int getMessageSize​(Message msg)
        Returns the total wire size of the message which was received or sent. If a message was modified after it has been received, or if a message was created by the application but never sent, this method will produce incorrect result. In those cases call calculateMessageSize() before calling this method as well as getMessageBodySize and similar. Notice that total wire size of the message is the exact number of bytes sent over the network when an application sends the message. The total wire size of the message may be slightly greater than the summ of the wire size of message headers, properties and the body, due to extra control information encoded in the overal message wire representation. If the body of the message is compressed, this method returns the size of the wire representation using compressed body bytes. Notice that the server may add additional control information into the message before sending it to consumers. Thus the size of the received message is normally slightly bigger than the size of the same message when it was sent.
        Throws:
        java.lang.IllegalArgumentException - if parameter is null or is a foreign Jakarta Messaging message implementation.
      • getMessageHeadersSize

        public static int getMessageHeadersSize​(Message msg)
        Returns the total wire size of the message headers for a message which was received or sent. If a message was modified after it has been received, or if a message was created by the application but never sent, this method will produce incorrect result. In those cases call calculateMessageSize() before calling this method.
        Throws:
        java.lang.IllegalArgumentException - if parameter is null or is a foreign Jakarta Messaging message implementation.
      • getMessagePropertiesSize

        public static int getMessagePropertiesSize​(Message msg)
        Returns the total wire size of the message properties for a message which was received or sent. If a message was modified after it has been received, or if a message was created by the application but never sent, this method will produce incorrect result. In those cases call calculateMessageSize() before calling this method.
        Throws:
        java.lang.IllegalArgumentException - if parameter is null or is a foreign Jakarta Messaging message implementation.
      • getMessageBodySize

        public static int getMessageBodySize​(Message msg)
        Returns the total wire size of the message body for a message which was received or sent. If a message was modified after it has been received, or if a message was created by the application but never sent, this method will produce incorrect result. In those cases call calculateMessageSize() before calling this method. If the body of the message is compressed, this method returns the size of the compressed wire representation.
        Throws:
        java.lang.IllegalArgumentException - if parameter is null or is a foreign Jakarta Messaging message implementation.
      • calculateMessageSize

        public static int calculateMessageSize​(Message msg)
                                        throws JMSException
        Calculates and returns total size of the message wire representation. This method always creates internally the actual wire format of the message regardless of the state of the message.
        Throws:
        java.lang.IllegalArgumentException - if parameter is null or is a foreign Jakarta Messaging message implementation.
        JMSException - if an error occurred while building message wire representation.
      • setAllowCloseInCallback

        public static void setAllowCloseInCallback​(boolean allow)
        Sets if the Session.close(), Connection.close(), Connection.stop(), JMSContext.close() or JMSContext.stop() methods can be called in the MessageListener callback. According to the Jakarta Messaging 2.0 specification, calling any of these methods must trigger an IllegalStateException or an IllegalStateRuntimeException. If calling them inside the callback is allowed then the close() or stop() method called inside the callback will not throw an exception and will proceed without waiting for the same callback to return.
      • getAllowCloseInCallback

        public static boolean getAllowCloseInCallback()
        Returns if allowed to call close() in callbacks.
      • setAllowCallbackInClose

        @Deprecated
        public static void setAllowCallbackInClose​(boolean allow)
        Deprecated.
        This method has been misnamed and replaced by setAllowCloseInCallback.
      • getAllowCallbackInClose

        @Deprecated
        public static boolean getAllowCallbackInClose()
        Deprecated.
        This method has been misnamed and replaced by getAllowCloseInCallback.
      • setExceptionOnFTSwitch

        public static void setExceptionOnFTSwitch​(boolean callExceptionListener)
        Sets if ExceptionListener set on the Connection should be called after fault-tolerant switch. When EMS application performs fault-tolerant switch it may notify the Connection's ExceptionListener by calling it with JMSException providing the information about fault-tolerant switch. If calling the Connection's ExceptionListener is set, it is called with the JMSException which has the vendor error code (JMSException.getErrorCode()) set to the String in the form:
        FT-SWITCH: <new-server-url>
        An EMS application can recognize such calls by analyzing the error code in the passed JMSException and perform necessary actions. Notice that the ExceptionListener is called with the special JMSException only when fault-tolerant switch has been performed succesfully. In case the fault-tolerant switch has failed, the Connection's ExceptionListener will be called with regular JMSException (it will not have error code in the form 'FT-SWITCH: <new-server-url>') specifying that the connection to EMS Server has been terminated. Notice that by default Connection's ExceptionListener is not called after a successfull fault-tolerant switch. NOTE: when the exception listener is called, the exception listener is not allowed to call any EMS method. To do so in this case risks a deadlock in the client.
      • getExceptionOnFTSwitch

        public static boolean getExceptionOnFTSwitch()
        Returns if exception listener is called on FT switch.
      • setExceptionOnFTEvents

        public static void setExceptionOnFTEvents​(boolean callExceptionListener)
        Sets if ExceptionListener set on the Connection should be called for all the following events: disconnected, each reconnect attempt, and reconnected. Similarly to setExceptionOnFTSwitch(boolean), if this method is called and if a Connection's ExceptionListener is set, (and the connection has FT urls), then all above events will trigger the call to the ExceptionListener.onException callback with a JMSException which has the vendor error code (JMSException.getErrorCode()) set to the String in the form:
        FT-SWITCH: event
        where event is:

        • Disconnected from server url, will attempt to reconnect
        • Reconnecting to next server url, attempt n out of m
        • Reconnected to server url

        An EMS application can recognize such calls by analyzing the error code in the passed JMSException and perform necessary actions. Notice that this property replaces the property Tibjms.setExceptionOnFTSwitch(boolean), which means that if both are called, only one "reconnected" event will be passed to the ExceptionListener.onException callback (the one described above). We recommend that if Tibjms.setExceptionOnFTSwitch(boolean) was formerly used, and the user wishes to capture all FT events, this new method be used instead and the ExceptionListener.onException callback modified to handle these new vendor error codes.

        NOTE: when the exception listener is called, the exception listener is not allowed to call any EMS method. To do so in this case risks a deadlock in the client.
      • getExceptionOnFTEvents

        public static boolean getExceptionOnFTEvents()
        Returns if exception listener is called on FT events (disconnected, reconnect attempt, and reconnected)
      • setSessionDispatcherDaemon

        public static void setSessionDispatcherDaemon​(boolean makeDaemon)
        Sets if Session dispatcher threads should be daemon. When EMS application uses message listeners, TIBCO Enterprise Message Service client creates internal dispatcher threads for each Session which has at least one asynchronous message consumer. By default session dispatcher threads are not set to be daemon threads.
      • getSessionDispatcherDaemon

        public static boolean getSessionDispatcherDaemon()
        Returns if session dispatcher threads are daemon.
      • setConnectAttempts

        public static void setConnectAttempts​(java.lang.String specs)
        Sets the parameters for the number of attempts the connections make to connect to the server. When too many clients connect to the same server, the server may not be able to accept all connections at the same time. This parameter specifies the number of attempts and delay between the attempt the connections perform in order to connect to the server. The value of this parameter is a String in the form "NN[,DELAY]" where NN is the number of attempts and DELAY is delay in milliseconds between the attempts. Minimum value of NN is 1, minimum value of DELAY is 250 milliseconds. Default value used is "2,500".
      • getConnectAttempts

        public static java.lang.String getConnectAttempts()
        Returns the connect attempts setting.
      • setReconnectAttempts

        public static void setReconnectAttempts​(java.lang.String specs)
        Sets the parameter for the number of attempts the connections make to reconnect to the backup server during fault-tolerant switch. This parameter is similar to the parameter set by setConnectAttempts method. The difference is that it may be necessary to use different parameters during reconnect than during the initial connect. Initial connect of the clients to the server is normally distributed in time and there are less chances of the server exceeding its maximum accept queue. During fault-tolerant switch, all connected clients automatically try to reconnect to the backup server, approximately at the same time. When the number of connections is large, it may require more attempts to reconnect than the initial connect. The value of this parameter is a String in the form "NN[,DELAY]" where NN is the number of attempts and DELAY is delay in milliseconds between the attempts. Minimum value of NN is 1, minimum value of DELAY is 250 milliseconds. Default value used is "4,500".
      • getReconnectAttempts

        public static java.lang.String getReconnectAttempts()
        Returns the reconnect attempts setting.
      • setConnectAttemptTimeout

        public static void setConnectAttemptTimeout​(int timeout)
        Sets the parameter for the maxmimum amount of time a client will wait for the connection to be established. This timeout is in milliseconds When too many clients connect to the same server, the server may not be able to accept all connections at the same time or may run out of system resources. This parameter specifies the amount of time a client is willing to wait for a connection to be established. Internally the client library will tear down any hung connections (either because of non-availability of system resources or some other EMS server problem) after this timeout. NOTE: minimum value is 100 milliseconds, if value less than 100 milliseconds is specified, then during the connection establishment the minimum value of 100 milliseconds is used. Default value is 0, i.e no timeout.
      • getConnectAttemptTimeout

        public static int getConnectAttemptTimeout()
        Returns the connect attempt timeout value
      • setReconnectAttemptTimeout

        public static void setReconnectAttemptTimeout​(int timeout)
        Sets the parameter for the maxmimum amount of time a client will wait for the reconnect to complete. This timeout is in milliseconds This parameter is similar to setConnectAttemptTimoeut The difference is that it may be necessary to use different parameters during reconnect than during the initial connect. Initial connect of the clients to the server is normally distributed in time and there are less chances of the server exceeding its maximum accept queue. During fault-tolerant switch, all connected clients automatically try to reconnect to the backup server, approximately at the same time. When the number of connections is large, it may require more reconnect time to reconnect than the initial connect. The value of this property is an integer in milliseconds. NOTE: minimum value is 100 milliseconds, if value less than 100 milliseconds is specified, then during the connection establishment the minimum value of 100 milliseconds is used. Default value is 0, i.e no timeout.
      • getReconnectAttemptTimeout

        public static int getReconnectAttemptTimeout()
        Returns the reconnect attempt timeout value
      • setSocketReceiveBufferSize

        public static void setSocketReceiveBufferSize​(int size)
        Sets the size of the socket receive buffer size for client connections. Some operating systems may ignore this setting.
      • getSocketReceiveBufferSize

        public static int getSocketReceiveBufferSize()
        Returns the size of socket receive buffer.
      • setSocketSendBufferSize

        public static void setSocketSendBufferSize​(int size)
        Sets the size of the socket send buffer size for client connections. Some operating systems may ignore this setting.
      • getSocketSendBufferSize

        public static int getSocketSendBufferSize()
        Returns the size of socket send buffer.
      • setPingInterval

        public static void setPingInterval​(int seconds)
        Sets the ping interval in seconds used by inactive connections. Zero value disables pinging inactive connections. This method, if necessary, should be called before the first connection is created by the application. Subsequent calls have no effect.
      • getPingInterval

        public static int getPingInterval()
        Returns the ping interval in seconds used by inactive connections.
      • setSocketConnectTimeout

        public static void setSocketConnectTimeout​(long milliseconds)
        Sets the timeout in milliseconds used by low-level socket connect calls. This only used with Java version 1.4.0 or higher.
      • getSocketConnectTimeout

        public static long getSocketConnectTimeout()
        Returns the timeout in milliseconds used by low-level socket connect calls. This only used with Java version 1.4.0 or higher.
      • setEncoding

        public static void setEncoding​(java.lang.String encodingName)
                                throws JMSException
        Set global string encoding for messages. Specified encoding will apply to all String values and names of properties and message fields but does not apply to message header fields and writeUTF method of BytesMessage.
        Throws:
        JMSException
      • getEncoding

        public static java.lang.String getEncoding()
        Retursn global string encoding for messages. Returns null if encoding is not set. If global encoding is not set, encoding can be set for each message. Otherwise messages use default encoding UTF8 to encode strings in the wire representation of the message.
      • setMessageEncoding

        public static void setMessageEncoding​(Message message,
                                              java.lang.String encodingName)
                                       throws JMSException
        Set string encoding for message. This will override global encoding setting. Specified encoding will apply to all String values and names of properties and message fields but does not apply to message header fields and writeUTF method of BytesMessage.
        Throws:
        JMSException
      • getMessageEncoding

        public static java.lang.String getMessageEncoding​(Message message)
        Returns string encoding name set for this message. Returns null if no encoding was set, in that case message uses default encoding UTF8.
      • getAsBytes

        public static byte[] getAsBytes​(Message message)
                                 throws JMSException
        Return a copy of the message data as a byte array, suitable for archiving in a file. To reconstruct the message from bytes use method createFromBytes(). Parameter must be an instance of TIBCO Enterprise Message Service message object.
        Throws:
        JMSException
      • createFromBytes

        public static Message createFromBytes​(byte[] bytes)
                                       throws JMSException
        Create a message from specified byte array. Specified byte array must be previously obtained using method getAsBytes(). Created message is set to read-only state, use setWriteable method to enable message modification without erasing its content.
        Throws:
        JMSException
      • makeWriteable

        public static void makeWriteable​(Message message)
                                  throws JMSException
        Set message to writeable state without resetting its content.
        Throws:
        JMSException
      • getConnectionActiveURL

        public static java.lang.String getConnectionActiveURL​(Connection connection)
                                                       throws JMSException
        Returns a string representing the URL of the server that this connection is currently connected to.
        Throws:
        JMSException
      • getConnectionActiveURL

        public static java.lang.String getConnectionActiveURL​(JMSContext context)
        Returns a string representing the URL of the server that the connection used by this context is currently connected to.
        Throws:
        JMSRuntimeException
        Since:
        EMS 8.0
      • setNPSendCheckMode

        public static void setNPSendCheckMode​(MessageProducer producer,
                                              int mode)
        Set the mode defining when a producer should check the result of sending a NON_PERSISTENT message.

        This mode only applies to messages sent using the javax.jms.DeliveryMode.NON_PERSISTENT delivery mode and a non-transactional Session; it does not apply to cases when a message was sent using the javax.jms.DeliveryMode.PERSISTENT or the RELIABLE_DELIVERY delivery mode or if the corresponding Session is transactional.

        If the producer's send check mode is not set, it may execute the mode applied globally to all producers via the EMS server parameter. Setting any mode other than NPSEND_CHECK_DEFAULT unconditionally overrides the global setting defined by the server.

        Normally, applications use the server's setting or configure producers with a specific send mode only once. However, if required, applications may choose to change this mode before sending every message.

        When a producer does not check the result of sending a message, it will not know if any problem has occurred and the message was not processed by the server. If a producer checks the result of the send, the send method will receive the server's response to the send and throw the appropriate exception if any problem has occurred. However, this will reduce the producer's performance.

        Parameters:
        producer - message producer, must not be null
        mode - one of constants NPSEND_CHECK_DEFAULT, NPSEND_CHECK_ALWAYS, NPSEND_CHECK_NEVER, NPSEND_CHECK_TEMP_DEST, NPSEND_CHECK_AUTH or NPSEND_CHECK_TEMP_AUTH
        Throws:
        java.lang.IllegalArgumentException - if the producer is null or if the mode value is invalid.
        Since:
        EMS 4.4
        See Also:
        getNPSendCheckMode(javax.jms.MessageProducer)
      • setNPSendCheckMode

        public static void setNPSendCheckMode​(JMSProducer producer,
                                              int mode)
        Set the mode defining when a producer should check the result of sending a NON_PERSISTENT message.

        This mode only applies to messages sent using the javax.jms.DeliveryMode.NON_PERSISTENT delivery mode and a parent JMSContext with a non-transactional underlying Session; it does not apply to cases when a message was sent using the javax.jms.DeliveryMode.PERSISTENT or the RELIABLE_DELIVERY delivery mode or if the underlying Session of the corresponding JMSContext is transactional.

        If the producer's send check mode is not set, it may execute the mode applied globally to all producers via the EMS server parameter. Setting any mode other than NPSEND_CHECK_DEFAULT unconditionally overrides the global setting defined by the server.

        Normally, applications use the server's setting or configure producers with a specific send mode only once. However, if required, applications may choose to change this mode before sending every message.

        When a producer does not check the result of sending a message, it will not know if any problem has occurred and the message was not processed by the server. If a producer checks the result of the send, the send method will receive the server's response to the send and throw the appropriate exception if any problem has occurred. However, this will reduce the producer's performance.

        Parameters:
        producer - JMSProducer, must not be null
        mode - one of constants NPSEND_CHECK_DEFAULT, NPSEND_CHECK_ALWAYS, NPSEND_CHECK_NEVER, NPSEND_CHECK_TEMP_DEST, NPSEND_CHECK_AUTH or NPSEND_CHECK_TEMP_AUTH
        Throws:
        java.lang.IllegalArgumentException - if the producer is null or if the mode value is invalid.
        Since:
        EMS 8.0
        See Also:
        getNPSendCheckMode(javax.jms.JMSProducer)
      • setMulticastEnabled

        @Deprecated
        public static void setMulticastEnabled​(boolean enabled)
        Deprecated.
        As of release 8.3
        Set whether MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast.

        When enabled, MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast.

        The default is enabled.

        Parameters:
        enabled - true to enable multicast, false to disable multicast
        Since:
        EMS 5.0
      • getMulticastEnabled

        @Deprecated
        public static boolean getMulticastEnabled()
        Deprecated.
        As of release 8.3
        Get whether MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast.
        Returns:
        true if multicast is enabled
      • setMulticastDaemon

        @Deprecated
        public static void setMulticastDaemon​(java.lang.String port)
        Deprecated.
        As of release 8.3
        Set the port on which the EMS client will connect to the multicast daemon.

        A connection to the multicast daemon is required when multicast is enabled and a MessageConsumer is subscribed to a multicast-enabled topic.

        NOTE: setting the port with this method will override the default port supplied by the server and the port specified on the connection factory.

        Parameters:
        port - the port of the multicast daemon
        Since:
        EMS 5.0
      • getMulticastDaemon

        @Deprecated
        public static java.lang.String getMulticastDaemon()
        Deprecated.
        As of release 8.3
        Get the port on which the EMS client will connect to the multicast daemon.
        Returns:
        the port of the multicast daemon
      • isConsumerMulticast

        @Deprecated
        public static boolean isConsumerMulticast​(MessageConsumer consumer)
        Deprecated.
        As of release 8.3
        Checks if a MessageConsumer is receiving messages over multicast.
        Parameters:
        consumer - the MessageConsumer to check
        Returns:
        true if MessageConsumer is receiving messages over multicast
        Throws:
        java.lang.IllegalArgumentException - if consumer is null or foreign.
        Since:
        EMS 5.0
      • setMulticastExceptionListener

        @Deprecated
        public static void setMulticastExceptionListener​(TibjmsMulticastExceptionListener listener)
        Deprecated.
        As of release 8.3
        Registers a TibjmsMulticastExceptionListener for handling multicast exceptions.

        If a serious problem with EMS Multicast is detected, the MulticastExceptionListener is informed if one has been registered. It does this by calling the listener's onMulticastException method, passing it the affected MessageConsumer and a JMSException argument describing the problem.

        Parameters:
        listener - the URL of the multicast daemon
        Throws:
        java.lang.IllegalArgumentException - if listener is null.
        Since:
        EMS 5.0
      • setTraceFile

        public static void setTraceFile​(java.lang.String fileName)
                                 throws java.io.IOException
        Use this method to instruct the TIBCO EMS Client library to direct the tracing, that would normally go to stderr or stdout, to a file named fileName. This call alone does not generate tracing, that is, the tracing still needs to be enabled as usual: from the admin tool and/or with the ssl trace parameter in order to trace TLS connections' handshake.
        The trace file is opened in append mode. An IOException will be thrown if the file can not be opened, and the tracing will be directed to stderr or stdout based on the connection's tracing setting (check the admin command set server client_trace for more details).
        Since there is only one trace file per JVM, an IllegalStateException will be thrown if this method is called with a non null file name after a trace file has already been set.
        Pass null to this method to instruct the TIBCO EMS Client library to stop directing tracing to the file. Normal tracing (stderr or stdout) will then resume.
        Parameters:
        fileName - the name of the TIBCO EMS Client trace file for this JVM, or null to stop directing tracing to the file.
        Throws:
        java.io.IOException - if an error occurs while opening/creating the file.
        java.lang.IllegalStateException - if this method is called twice with a non null fileName.
        Since:
        EMS 5.0
      • recoverMsg

        public static void recoverMsg​(Message msg)
                               throws JMSException,
                                      IllegalStateException,
                                      java.lang.IllegalArgumentException
        Recover a single message.
        Parameters:
        msg - the Message to recover
        Throws:
        java.lang.IllegalArgumentException - if message is null or invalid.
        java.lang.IllegalStateException - if illegal Ack Mode or session is closed
        JMSException - if message was never delivered
        IllegalStateException
        Since:
        EMS 6.0