We've been pretty successful with the following configuration (see below).
Please note that you might need the latest snapshot.

                                                <jms:endpoints>
                                                        <jms:endpoint 
service="foo:jmsSender"
                                                                
endpoint="endpoint" role="provider" destinationStyle="queue"
                                                                
processorName="jca" jndiDestinationName="queue/testQueue"
                                                                
jndiConnectionFactoryName="java:/JmsXA" />
                                                </jms:endpoints>

and here is the consumer:

                                                        <jms:endpoint 
service="foo:inputReceiver"
                                                                
targetService="foo:rdbmsSender" endpoint="endpoint"
                                                                role="consumer" 
processorName="jca"
                                                                
bootstrapContext="#bootstrapContext"
                                                                
resourceAdapter="#jbossMQResourceAdapter"
                                                                
connectionFactory="#managedJmsFactory"
                                                                
defaultMep="http://www.w3.org/2004/08/wsdl/in-only";
                                                                
synchronous="true">
                                                                
<jms:activationSpec>
                                                                        <bean
                                                                                
class="org.jboss.resource.adapter.jms.inflow.JmsActivationSpec">
                                                                                
<property name="destination"
                                                                                
        value="queue/testQueue" />
                                                                                
<property name="destinationType"
                                                                                
        value="javax.jms.Queue" />
                                                                        </bean>
                                                                
</jms:activationSpec>
                                                        </jms:endpoint>

for which you will need the following references in your xbean file:

        <bean id="bootstrapContext"
                class="org.jencks.factory.BootstrapContextFactoryBean">
                <property name="threadPoolSize" value="25" />
        </bean>

        <bean id="jbossMQResourceAdapter"
                class="org.jboss.resource.adapter.jms.JmsResourceAdapter"
                singleton="true">
        </bean>

        <bean id="managedJmsFactory"
                class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName">
                        <value>java:/JmsXA</value>
                </property>
        </bean>

Be sure to use the Connection Factory java:/JmsXA since this is the one,
which supports XA transactions if required.

Best regards
Martin



johper wrote:
> 
> Using SM in JBoss with newly built SAR, everythins workd/deploys fine as
> long as ActiveMQ is the provider. 
> Now I would like to use JBoss-MQ from "within" SM. Changed my
> JMS-endpoints from using local ActiveMQ factories to JNDI lookups for
> resources in JBoss. But SM does not like my JMS-endpoints?
> When SM runs inside JBoss is JBoss JNDI tree accessible from my
> service-assemblies? JBossMQ factory has remote and local JNDI names,
> should I try the local one instead, since   both SM/JBoss runs in same VM?
> 
> This is what I am trying to do in my xbean file:
> 
>   <jms:endpoint service="b:jms" endpoint="jms" 
>               role="provider"
>               soap="true"
>                 destinationStyle="queue"
>                
> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>                 jndiProviderURL="localhost"
>                 jndiDestinationName="queue/myoutput"
>                 jndiConnectionFactoryName="ConnectionFactory" />
>                 
>   <jms:endpoint service="b:finalconsumer" endpoint="finalconsumer" 
>               targetService="c:final"
>               role="consumer" 
>               soap="true"
>               soapVersion="1.1"
>               destinationStyle="queue" 
>                
> initialContextFactory="org.jnp.interfaces.NamingContextFactory"
>                 jndiProviderURL="localhost"           
>               jndiDestinationName="queue/myinput" 
>               jndiConnectionFactoryName="ConnectionFactory"
>               defaultMep="http://www.w3.org/2004/08/wsdl/in-only"; />
> 
> In between there is an MDB in JBoss acting as the bridge..
> 
> TIA
> Johan
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JNDI-and-JBossMQ-tf2190321.html#a6060584
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to