You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2016/12/19 14:07:58 UTC

[jira] [Commented] (AXIS2-5825) [Axis2][Tibco] Correct usage of JMS API to create MessageConsumer

    [ https://issues.apache.org/jira/browse/AXIS2-5825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761247#comment-15761247 ] 

Hudson commented on AXIS2-5825:
-------------------------------

SUCCESS: Integrated in Jenkins build Axis2 #3610 (See [https://builds.apache.org/job/Axis2/3610/])
AXIS2-5825: Correctly handle JMS session instances that implement Session, but not QueueSession or TopicSession. (veithen: rev 1775081)
* (edit) axis2/modules/transport/jms/pom.xml
* (edit) axis2/modules/transport/jms/src/main/java/org/apache/axis2/transport/jms/JMSUtils.java
* (add) axis2/modules/transport/jms/src/test/java/org/apache/axis2/transport/jms/JMSUtilsTest.java


> [Axis2][Tibco] Correct usage of JMS API to create MessageConsumer
> -----------------------------------------------------------------
>
>                 Key: AXIS2-5825
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5825
>             Project: Axis2
>          Issue Type: Bug
>          Components: JMS transport
>    Affects Versions: 1.7.4
>            Reporter: Ziborov Egor
>            Priority: Minor
>
> When we tried to work with Tibco ESB we handle ClassCastException:
> {noformat}
> java.lang.ClassCastException: com.tibco.tibjms.TibjmsxSessionImp cannot be cast to javax.jms.QueueSession
> at org.apache.axis2.transport.jms.JMSUtils.createConsumer(JMSUtils.java:434)
> {noformat}
> Currently Axis2 logic based on correlation Queue (as destination) <-> QueueSession (as a session) and the same for the topics. But it's not correct. Offer rewrite method createConsumer(Session, Destination, String) to:
> {code:java}
>  public static MessageConsumer createConsumer(Session session, Destination dest, String messageSelector) throws JMSException {
>         return (dest instanceof Queue ?
>                 createQueueConsumer(session, (Queue)dest, messageSelector) :
>                 createTopicConsumer(session, (Topic) dest, messageSelector));
>     }
>     public static MessageConsumer createQueueConsumer(Session session, Queue queue, String messageSelector) throws JMSException {
>         return (session instanceof QueueSession) ?
>                 ((QueueSession)session).createReceiver(queue, messageSelector) :
>                 session.createConsumer(queue, messageSelector);
>     }
>     public static MessageConsumer createTopicConsumer(Session session, Topic topic, String messageSelector) throws JMSException {
>         return (session instanceof TopicSession) ?
>                 ((TopicSession)session).createSubscriber(topic, messageSelector, false) :
>                 session.createConsumer(topic, messageSelector);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org