users@genericjmsra.java.net

Re: Multiple resource-adapters with GenericJMSRA

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Wed, 05 Dec 2007 19:49:47 +0530

Hi Geert

Achten Geert wrote:
>
> Hi,
>
> we're trying to integrate with both MQSeries and Sun Java System Message
> Queue. Both integrations work flawless when used individually. However
> if we try to combine them, things go wrong. Apparently the GenericJMSRA
> uses the resource-adapter-config of IMQ when connecting to MQSeries.
>
> In the code we see that the DestinationAdapter uses a static field
> (returned by getInstance()). This static field can only be initiliazed
> once (per classloader), and so contains the wrong configuration. We are
> deploying the resource adapter on the container level.

This is right. The configuaration specified in resource-adapter-config
is set on the ResourceAdapter instance. This configuration is common
for all artifacts [MCF/ActivationSpec/AdminObjects] created against
that RA instance and hence, as per the connector spec, we use values
set in the ResourceAdapter unless overridden at the artifact level.

>
> Is there a way to use GenericJMSRA to connect to multiple brokers?

Unfortunately you cannot have two configurations [ra-configs] for a
resource adapter. Here is how multiple brokers can be configured for a
single standalone Generic RA deployment.
- Set all the common properties between both the brokers in ra-config
- Let's say you have one connection factory CF1 that needs to connect
to Sun MQ and another CF, CF2 that needs to connect to MQSeries.
Configure CF1 properties with Sun MQ related properties
Configure CF2 properties with MQSeries related properties.

Unfortunately, with this setup, you might have to duplicate multiple
configuration properties [relevant to a broker] across your various
objects. We haven't tested this scenario, but this should ideally
work. Please let us know if you face any issues.

Thanks
--Siva.

>
> Configuration information (GenericJMSRA version 1.6 on SJSAS 8.1_02
> b19-p08)