BizTalk JMS Adapter v1.1 fails with WebLogic JMS with error “Client id, myClientID , is in use.”

The Problem

This error occurs because a WebLogic JMS Connection Factory has been assigned a client ID. When using the adapter, if the transmit and receive transport handlers have both been configured with the same Connection Factory, then this exception can be thrown if BizTalk is transmitting and receiving messages. The adapter will create two connections from the factory: one for receiving, the other for transmitting. The second connection will fail (usually a send port) with this error (from WL 9.2):

The adapter failed to transmit message going to send port “SendPort1” with URL “jms://localhost:7001/testQueue/transmit/Text”. It will be retransmitted after the retry interval specified for this Send Port. Details:”An unexpected failure occurred while processing a message. The text associated with the exception is “Client id, subscriber, is in use.  The reason for rejection is “The JNDI name weblogic.jms.connection.clientid.subscriber was found, and was bound to an object of type weblogic.jms.frontend.FEClientIDSingularAggregatable : FEClientIDSingularAggregatable(SingularAggregatable(<6907397155431112969.1>:2):subscriber)”

The Cause

The failure occurs because the assigned client ID means the factory can ever only create one connection. This is a rather parochial reading of the JMS 1.1 spec as it is regardless of whether durable subscriptions are being used (or even topics). Previous versions of the BizTalk JMS adapter shared a single connection for both receives and transmits. In version 1.1, each side has its own connection, a feature (read: “bug fix”) necessitated by the different life-cycles BizTalk uses for transmit and receive endpoints.

 

The Fix

Use different connection factories for the transmit and receive transport handlers. Generally speaking, the receive side will have a factory with a client ID set. The transmit side will not.