Thanks for the pointer! I tried out your suggestion with the bridge example.
I got the following exception when starting up the ServiceMix. I think I
missed something. Looks like the jndi lookup is not working properly with
ServiceMix. I have configured the TestQueueConnectionFactory via OpenMQ
admin. This worked fine with MULE. 

--------------------
<jms:endpoint service="b:jms"
                endpoint="endpoint"
                role="provider" 
                destinationStyle="queue"
                jmsProviderDestinationName="bridge.output"
                connectionFactory="#openMQ"/>
                
  <!--bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
  </bean-->

    <bean name="openMQ"
class="org.springframework.jndi.JndiObjectFactoryBean">
         <property name="jndiName" value="TestQueueConnectionFactory" />
         <property name="jndiEnvironment">
           <props>
             <prop
key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory
             </prop>
             <prop key="specifications">1.1</prop>
             <prop
key="java.naming.provider.url">file:///Users/dongmeic/mq/tempstore</prop>
           </props>
        </property>
      </bean>
---------------------------------
Caused by: org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [com.sun.messaging.QueueConnectionFactory] to
required type [javax.jms.ConnectionFactory] for property
'connectionFactory'; nested exception is java.lang.IllegalArgumentException:
Cannot convert value of type [com.sun.messaging.QueueConnectionFactory] to
required type [javax.jms.ConnectionFactory] for property
'connectionFactory': no matching editors or conversion strategy found
        at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
        ... 27 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type
[com.sun.messaging.QueueConnectionFactory] to required type
[javax.jms.ConnectionFactory] for property 'connectionFactory': no matching
editors or conversion strategy found
        at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
        at
org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
        at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)




Jean-Baptiste Onofré wrote:
> 
> Hi,
> 
> ServiceMix uses ActiveMQ as default JMS provider but it doesn't mean that
> you have to use ActiveMQ.
> ActiveMQ can interact with other JMS provider such as Websphere MQ.
> 
> In your case, you need to use an OpenMQ ConnectionFactory.
> For example, you can make a consumer endpoint like this:
> 
> <jms:consumer service="your:service" endpoint="OpenMQConsumer"
>   destinationName="your.queue"
>   connectionFactory="#openMQ"/>
> 
> <bean name="openMQ"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>                 <property name="jndiName" value="TopicConnectionFactory" 
> />
>                 <property name="jndiEnvironment">
>                         <props>
>                                 <prop
> key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</spring:prop>
>                                 <prop
> key="java.naming.provider.url">/tmp/TestMQ</spring:prop>
>                         </props>
>                 </property>
> </bean>
> 
> Regards
> JB
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-consume-provide-messages-to-OpenMQ-tp28443359p28451171.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to