axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5825) [Axis2][Tibco] Correct usage of JMS API to create MessageConsumer
Date Mon, 19 Dec 2016 15:44:58 GMT

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

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

SUCCESS: Integrated in Jenkins build axis2-1.7 #95 (See [https://builds.apache.org/job/axis2-1.7/95/])
AXIS2-5825: Merge r1775081 to the 1.7 branch. (veithen: rev 1775103)
* (edit) axis2
* (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


Mime
View raw message