cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Shakirin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5769) JMS message redelivery in CXF 2.7.X
Date Mon, 16 Jun 2014 15:36:04 GMT

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

Andrei Shakirin commented on CXF-5769:
--------------------------------------

After some analyses I came to the conclusion to leave the CXF 2.7.X implementation as it is.
Support transacted session without TransactionManager can break the compatibility and is not
desired for minor release.

> JMS message redelivery in CXF 2.7.X
> -----------------------------------
>
>                 Key: CXF-5769
>                 URL: https://issues.apache.org/jira/browse/CXF-5769
>             Project: CXF
>          Issue Type: Improvement
>          Components: Transports
>    Affects Versions: 2.7.11
>            Reporter: Andrei Shakirin
>            Assignee: Andrei Shakirin
>
> I am trying to get working the JMS message redelivery in CXF 2.7.X.
> Use case: CXF client sends JMS message to the service one-way operation. Business implementation
of oneWay method throws runtime exception.
> Expected: message will be redelivered according RedeliveryPolicy and finally placed in
dead queue, if all attempts are failed.
> In CXF 3.0.0 JMS transport supports redelivery out of the box for transacted sessions
and oneway MEP.
> In CXF 2.7.X JMSDestination onMessage() method doesn't throw exception, because of the
following check:
> {code}
>             //need to propagate any exceptions back to Spring container 
>             //so transactions can occur
>             if (inMessage.getContent(Exception.class) != null && session != null)
{
>                 PlatformTransactionManager m = jmsConfig.getTransactionManager();
>                 if (m != null) {
>                     TransactionStatus status = m.getTransaction(null);
>                     JmsResourceHolder resourceHolder =
>                         (JmsResourceHolder) TransactionSynchronizationManager
>                             .getResource(jmsConfig.getConnectionFactory());
>                     boolean trans = resourceHolder == null 
>                         || !resourceHolder.containsSession(session);
>                     if (status != null && !status.isCompleted() && trans)
{
>                         Exception ex = inMessage.getContent(Exception.class);
>                         if (ex.getCause() instanceof RuntimeException) {
>                             throw (RuntimeException)ex.getCause();
>                         } else {
>                             throw new RuntimeException(ex);
>                         }
>                     }
>                 }
>             }
> {code}
> resourceHolder.containsSession(session) finds the session and returns true => exception
is never thrown from onMessage => message will not be redelivered.
> The redelivery should work for transacted sessions even without configured TransactionManager
(see CXF-2550).
> I would update exception processing in the same way as in CXF 3.0.0: propagate all Runtime
exceptions to the container in case of one way communication style. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message