« Return to Thread: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x

Re: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x

by JackyMule :: Rate this Message:

Reply to Author | View in Thread

Hi, I need your help about openMQ & mule2.0. I posted couple of queries in mule forum about my problem but it seems no one has used openMQ with mule2 yet. I came across your post where you says setup working fine for you.
http://www.nabble.com/Interfacing-to-Open-MQ-tt15740772.html#a16731933

I would like to know your setup to make mule2.0 working with openMQ. I am using openMQ4.1 & Mule2.0. I am using configuration shown below.
       
        <jms:connector name="openMQConnector" connectionFactory-ref="openMQ" />
       
        <spring:bean name="openMQ" class="org.springframework.jndi.JndiObjectFactoryBean">
  <spring:property name="jndiName" value="TopicConnectionFactory" />
  <spring:property name="jndiEnvironment">
  <spring:props>
                        <spring:prop key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</spring:prop>
                                <spring:prop key="java.naming.provider.url">file:///c:/TestMQ</spring:prop>
  </spring:props>
  </spring:property>
        </spring:bean>

I have configured OpenMQ using OpenMQ admin gui & created TopicConnectionFactory in OpenMQ. As soon as i start my Mule server it throws me IllegalArgumentException & says "In valid connection factory : sun.java....connectionfactory"

I debug & cross checked in mule jms code. OpenMQ creating object of ConnectionFactory rather then TopicConnectionFactory so finally throwing error due to this mismatch. Mule JmsConnector check for matching with QueueConnectionFactory & TopicConnectionFactory.  Though object was created was of type ConnectionFactory so finaly throws error.

I am not able to understand why openMQ is creating an Instance of ConnectionFactory rather then TopicConnectionFactory, as TopicConnectionFactory is configured.

Did you face this problem?
Can you suggest any solution for this problem?

Please share your views for the same.

Thanks & regards,
JackyMule


ddossot wrote:
Sure thing:

        <spring:bean name="jndiDestinationAdvice"
class="mule.custom.JndiDestinationInterceptor" />


        <spring:bean id="createDestinationAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
                <spring:property name="advice" ref="jndiDestinationAdvice" />

                <spring:property name="patterns">
                        <spring:list>
                                <spring:value>.*createDestination.*</spring:value>
                        </spring:list>
                </spring:property>
        </spring:bean>


        <spring:bean name="proxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
                <spring:property name="beanNames" value="jndiJmsSupport" />


                <spring:property name="interceptorNames">
                        <spring:list>
                                <spring:value>createDestinationAdvisor</spring:value>
                        </spring:list>
                </spring:property>

        </spring:bean>

----

package mule.custom;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class JndiDestinationInterceptor implements MethodInterceptor {


    public Object invoke(final MethodInvocation invocation) throws Throwable {
        // destination name is in: invocation.getArguments()[1]
        // do JNDI lookup here or invocation.proceed()
        return yourDestination;

    }

}

---

HTH
D.


On Thu, May 22, 2008 at 8:06 AM, rshah <raju_sh@hotmail.com> wrote:

>
> Hi,
>
> I have been struggling with this too. I use OpenMQ. The queue name I pass
> needs to be looked up in jndi but I can't find a way to do that. I was
> looking for jndiDestinations and forceJndiDestinations in Mule 2.0 and then
> I came across this forum which talks about exactly the same issue.
>
> Can you please provide your Spring interceptor config to work around this?
>
> Thanks,
> Raj
>
>
> ddossot wrote:
> >
> > An option, but maybe not "the right option" (Andrew?), consists in
> > sub-classing Jms11Support, override createDestination to perform the JNDI
> > lookup and inject this custom support in your connector like this:
> >
> >     <jms:connector name="yourJmsConnector" specification="1.1"
> >         connectionFactory-ref="yourConnectionFactory">
> >         <spring:property name="jmsSupport" ref="jndiJmsSupport" />
> >     </jms:connector>
> >
> >     <spring:bean name="jndiJmsSupport" class="your.Jms11Support">
> >         <spring:constructor-arg ref="yourJmsConnector" />
> >     </spring:bean>
> >
> > If you do not like sub-classing, you can just add a Spring interceptor on
> > the createDestination method of the standard Jms11Support class (I have
> > done
> > this and can provide the config).
> >
> > HTH
> > D.
> >
> >
> > On Fri, May 16, 2008 at 7:15 AM, muletester <hemadrim@yahoo.com> wrote:
> >
> >>
> >> JMS11Support in Mule1.4 accepts jndiDestinations parameter and if this
> is
> >> set
> >> to true, it does a look up of queue/topic in JNDI tree. How can we
> >> achieve
> >> this similar functionality in Mule 2.0 in JMS11Support? If not, Is there
> >> any
> >> other way where we can look up queue/topic in JNDI Tree, since current
> >> version doesn't accept jndiDestinations or forceJndiDestinations.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/JMS11Support-in-Mule2.0-not-comaptible-with-that-in-Mule-1.4.x-tp17275750p17275750.html
> >> Sent from the Mule - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/JMS11Support-in-Mule2.0-not-comaptible-with-that-in-Mule-1.4.x-tp17275750p17406331.html
> Sent from the Mule - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

 « Return to Thread: JMS11Support in Mule2.0 not comaptible with that in Mule 1.4.x