Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When a JMS client connects to the EI Message Broker, the connection parameters are specified using the connectionfactory interface as shown below.

...

  • <transport>: The transport should be TCP.

    Info

    To support more transports, the ''client.transportTransportConnection'' class needs to be updated along with the parsing to handle the transport.

  • <host>: The IP address.
  • <port>: The default AMQP port of 5672 is used if no port is specified.
  • <option>='<value>': Each broker can have additional options that are specific to that broker. The following are the options that are currently implemented:

    OptionDefault ValueDescription

    retries

    1

    The number of retry attempts when connecting to the broker.

    ssl

    false

    Use SSL on the connection.

    connecttimeout

    30000

    How long (in milliseconds) to wait for the connection to succeed.

    connectdelay

    none

    How long (in milliseconds) to wait before attempting to reconnect. The recommended value is 30000 milliseconds.

Using the 'failover' option

...

  • <method>: Listed below are the supported methods. Note that 'singlebroker' is used when only one broker is present and the 'roundrobin' method is used with multiple brokers. The 'nofailover' method is useful if you are using a 3rd party tool that has its own reconnection strategy that you wish to use.

    MethodDescription

    singlebroker

    This will only use the first broker in the list.

    roundrobin

    This method tries each broker in turn.

    nofailover

    [New in 0.5] This method disables all retry and failover logic.

    onetimeThis method ensures that XA transactions do not failover from one node another. That is, if the connection fails before all messages are committed to the broker node, the XA transaction will be canceled. The client will then reconnect to the next available broker in the list and resend all the messages from the beginning. See Handling Distributed Transactions for more information
    Note

    The <method> value in the URL may also be any valid class on the classpath that implements the FailoverMethod interface.

  • <option>: The following options should be used for the failover method.

    OptionDefault ValueDescription

    cyclecount

    1

    The number of times to loop through the list of available brokers before failure.

...

Code Block
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?failover='roundrobin'&cyclecount='2'&brokerlist='tcp://localhost:5673?retries='5'&connectdelay='50';tcp://localhost:5674?retries='5'&connectdelay='50';tcp://localhost:5675?retries='5'&connectdelay='5030000''