JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-3423

Certain JMS ReplyTo scenarios don't work (Need more testing on)

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix or Usage Issue
  • Affects Version/s: 2.0.1
  • Fix Version/s: None
  • Component/s: Core: Routing / Filters, Transport: JMS
  • Labels:
    None
  • User impact:
    Medium
  • Effort points:
    2
  • Affects Docs:
    Yes
  • Migration Impact:
    ReplyTo scenarios need more documentation
  • Similar Issues:
    None

Description

I just found a case where replyTo is not working (for JMS at least). Consider the following:

<model>
        <service name="In-Optional-Out_Out-Optional-In-Service">
            <inbound>
                <vm:inbound-endpoint ref="inboundEndpoint"/>
            </inbound>
            <script:component>
                <script:script engine="groovy">
                    if (message.getProperty("foo") != null)
                    {
                        message.setProperty("bar", "baz")
                        return message
                    }
                    else
                        return message
                </script:script>
            </script:component>
            <outbound>
                <outbound-pass-through-router>
                    <outbound-endpoint ref="ExternalEndpoint" remoteSync="true"/>
                    <!-- Mule will automatically listen n this destination when Remote sync is set. If this is not se
                     a temprary destination is set up -->
                    <reply-to address="jms://reply"/>
                </outbound-pass-through-router>
            </outbound>
        </service>

        <service name="Mock-External-App">
            <inbound>
                <inbound-endpoint ref="ExternalEndpoint"/>
            </inbound>
            <script:component>
                <script:script engine="groovy">
                    message.setProperty("externalApp", "Received")
                    if (message.getProperty("bar") != null)
                        return "bar header received"
                    else
                        return null
                </script:script>
            </script:component>
        </service>
    </model>

I set the replyTo on the first component and I set remoteSync="true". This should create/listen on a jms destination "reply", but doesn't.
It does work if REPLY-TO is NOT set but remoteSync=true is i.e. temporary destination.

Looking at the code, ReplyTo only works if the JMS_ReplyTo header is set no the MULE_REPLY_TO. In the JmsMessageDispatcher, it seems we need something like:

Object tempReplyTo = eventMsg.removeProperty(JmsConstants.JMS_REPLY_TO);
                if(tempReplyTo==null)
                {
                    //It may be a Mule URI or global endpoint Ref
                    tempReplyTo = eventMsg.removeProperty(MuleProperties.MULE_REPLY_TO_PROPERTY);
                    if(tempReplyTo!=null)
                    {
                        if(tempReplyTo.toString().startsWith("jms://"))
                        {
                            tempReplyTo = tempReplyTo.toString().substring(6);
                        }
                        else
                        {
                            EndpointBuilder epb = event.getMuleContext().getRegistry().lookupEndpointBuilder(tempReplyTo.toString());
                            if(epb != null)
                            {
                                tempReplyTo = epb.buildOutboundEndpoint().getEndpointURI().getAddress();
                            }
                        }
                    }

But adding this causes some odd behaviour in my test case. Now when <Reply-To> is set the test fails because the the session gets closed.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds

CE Bamboo View RSS feed

People

  • Assignee:
    Ross Mason
    Reporter:
    Ross Mason
Vote (0)
Watch (0)

Dates

  • Created:
    02/Jun/08 05:33 AM
    Updated:
    25/Nov/08 06:21 PM
    Resolved:
    17/Nov/08 10:43 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.