commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil Kumar C <ani...@mindtree.com>
Subject Re: [messenger] patch for working with JBossMQ
Date Fri, 15 Feb 2002 12:47:11 GMT
I had similar problems while using with weblogic. I also have done a fix 
which is very similar to what you mentioned.

I have also added additional these additional methods
    public int getDeliveryMode(Destination destination) throws JMSException;
    public boolean getDisableMessageID(Destination destination) throws 
JMSException;
    public boolean getDisableMessageTimestamp(Destination destination) 
throws JMSException;
    public int getPriority(Destination destination) throws JMSException;
    public long getTimeToLive(Destination destination) throws JMSException;
    public void setDeliveryMode(Destination destination,int 
deliveryMode) throws JMSException;
    public void setDisableMessageID(Destination destination, boolean 
value) throws JMSException;
    public void setDisableMessageTimestamp(Destination 
destination,boolean value) throws JMSException;
    public void setPriority(Destination destination,int defaultPriority) 
throws JMSException;
    public void setTimeToLive(Destination destination,long timeToLive) 
throws JMSException;

Let me know if you are interested in adding these methods and I will 
send over the patch

Anil

James Strachan wrote:

>From: "Saimon Moore" <saimonmoore@yahoo.co.uk>
>
>>Well I've managed to patch the code up to work with
>>JBossMQ.
>>
>
>Great! Thanks Saimon I'll apply these patches now.
>
>
>>There were two problems:
>>
>>1. When a ConnectionFactory is looked up in JBossNS,
>>you get an org.jboss.mq.SpyConnectionFactory object
>>returned which you have to cast to the appropriate
>>object i.e. QueueConnectionFactory or
>>TopicConnectionFactory. However, if you test the
>>instance, both of the previous are valid.. i.e.
>>
>><code>
>>if (factory instanceof TopicConnectionFactory)
>></code>
>>
>>will return true even if factory has been previously
>>cast to QueueConnectionFactory and vice-versa.
>>
>>There is a similar problem when creating the
>>Connection. The jboss connection factory returns an
>>org.jboss.mq.SpyConnection object that has to be cast
>>to either QueueConnection or TopicConnection but
>>checking the instance of the connection is not
>>sufficient to diferentiate between the two.
>>
>>What I did to overcome this is re-implement both
>>createConnection() and createSession() from
>>SessionFactory in JNDISessionFactory relying on the
>>lookup name, to differentiate and correctly create the
>>appropriate factories,connections and sessions.
>>
>
>Maybe other providers might do this kinda thing, so maybe we should add a
>boolean property to JNDISessionFactory so that it doesn't matter what the
>name is in JNDI, we can coerce it into a Topic or Queue connection if the
>object implements both interfaces.
>
>e.g.
>
><jndi lookupName="TopicConnectionFactory" topic="true">
>...
>
>
><jndi lookupName="QueueConnectionFactory" topic="false">
>...
>
>>Anyway, it's working fine now but I'm in the process
>>of testing it out with other JMS providers e.g.
>>AshnaMQ, and j2eesdk1.3 (By the way...what's the
>>protocol used for this i.e. the provider url?)
>>
>
>The existing Messenger.xml in CVS should work fine for j2eesdk - though I
>think the JNDI lookup name depends on if you are inside the j2ee server or
>not. From memory I think its either TopicConnection (outside) or
>java:env/TopicConnection (inside j2ee).
>
>James
>
>
>
>
>_________________________________________________________
>
>Do You Yahoo!?
>
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message