Multiple resource-adapters with GenericJMSRA

View: New views
4 Messages — Rating Filter:   Alert me  

Multiple resource-adapters with GenericJMSRA

by Achten Geert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
 
Is there a way to use GenericJMSRA to connect to multiple brokers?
 
Configuration information (GenericJMSRA version 1.6 on SJSAS 8.1_02 b19-p08)
-------------------------
 
asadmin create-resource-adapter-config --user admin --passwordfile "C:\Documents and Settings\bkdevel\.asadminprefs" --property SupportsXA=true:ProviderIntegrationMode=javabean:ConnectionFactoryClassName=com.sun.messaging.ConnectionFactory:\CommonSetterMethodName=setProperty:UserName=guest:Password=guest:\QueueConnectionFactoryClassName=com.sun.messaging.QueueConnectionFactory:\TopicConnectionFactoryClassName=com.sun.messaging.TopicConnectionFactory:\QueueClassName=com.sun.messaging.Queue:TopicClassName=com.sun.messaging.Topic:\LogLevel=info:UserName=guest:Password=guest:XAQueueConnectionFactoryClassName=com.sun.messaging.XAQueueConnectionFactory:\XATopicConnectionFactoryClassName=com.sun.messaging.XATopicConnectionFactory:\XAConnectionFactoryClassName=com.sun.messaging.XAConnectionFactory genericra_imq
...
asadmin create-admin-object --user admin --passwordfile "C:\Documents and Settings\bkdevel\.asadminprefs" --raname genericra_imq --restype javax.jms.Queue --property DestinationProperties=imqDestinationName\\=BatchDMQ jms/BatchDMQ
 

create-resource-adapter-config --port ${appserv.port} -s=false ${appserv.target} --property SupportsXA=true:ProviderIntegrationMode=jndi:JndiProperties=java.naming.security.authentication\\=none,java.naming.factory.initial\\=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url\\=file\\://${bindingsURLEscaped}:Loglevel=info:RMPolicy=OnePerPhysicalConnection genericra

...

create-admin-object --port ${appserv.port} -s=false --raname genericra --restype javax.jms.Queue ${cluster.target} --property DeadMessageDestinationJndiName=com.ardatis.ventouris.VentourisDeadMessageQueue jms/RSVZMQDeadMessageQueue

Any help would be appreciated,

Kind regards,

Geert

______________________________________________________________________

 

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.

If you have received this email in error please notify the system manager at : systeembeheer@... or call +32-(0)11-240234.

This footnote also confirms that this email message has been swept by Sophos for the presence of computer viruses.

______________________________________________________________________

 


Re: Multiple resource-adapters with GenericJMSRA

by Sivakumar Thyagarajan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Multiple resource-adapters with GenericJMSRA

by Stijn Van Den Enden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Siva.

        we tested your suggestion:
1) changed the resource-adapter-config so it includes no Broker  
specific properties anymore
2) changed the ra.xml - added property description for the  
ProviderIntegrationMode en JndiProperties to make sure the properties  
get set correctly
3) changed the creation of the admin and resource-pool to include the  
aforementioned properties

and this seems to work. The admin-object can now be resolved  
correctly and both the connections to MQSeries and iMQ are established.

Is it correct that the ConnectionFactory can access the resource  
adapter configuration (ResourceAdapterAssociation), and the  
administration object cannot access the same configuration? Is this a  
limitation of the JCA 1.5 specification?

Many thanks for your help,

Kind regards,

Stijn


On 05 Dec 2007, at 15:19, Sivakumar Thyagarajan wrote:

> 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)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Multiple resource-adapters with GenericJMSRA

by Sivakumar Thyagarajan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Stijn Van Den Enden wrote:

> Hi Siva.
>
>     we tested your suggestion:
> 1) changed the resource-adapter-config so it includes no Broker specific
> properties anymore
> 2) changed the ra.xml - added property description for the
> ProviderIntegrationMode en JndiProperties to make sure the properties
> get set correctly
> 3) changed the creation of the admin and resource-pool to include the
> aforementioned properties
>
> and this seems to work. The admin-object can now be resolved correctly
> and both the connections to MQSeries and iMQ are established.

Great.

> Is it correct that the ConnectionFactory can access the resource adapter
> configuration (ResourceAdapterAssociation), and the administration
> object cannot access the same configuration? Is this a limitation of the
> JCA 1.5 specification?

Yes that is right. There is no mechanism today for the
AdministereredObject to support ResourceAdapterAssociation interface
in the current 1.5 version of the specification. We had also added
this comment in the code earlier
http://fisheye5.cenqua.com/browse/genericjmsra/src/java/com/sun/genericra/outbound/DestinationAdapter.java?r=1.3#l92

Thanks
--Siva.

>
> Many thanks for your help,
>
> Kind regards,
>
> Stijn
>
>
> On 05 Dec 2007, at 15:19, Sivakumar Thyagarajan wrote:
>
>> 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)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price