Details

  • Type: Patch submission Patch submission
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.0.0, 3.0.1, 3.1.0
  • Fix Version/s: 3.0.1, 3.1.0
  • Labels:
    None
  • Environment:

    tested in Linux using vm activemq, hornetq

  • User impact:
    High
  • Configuration:
    Hide
    <model name="test">
     
    		<service name="router">
    			<inbound>
    				<vm:inbound-endpoint path="inBound" exchange-pattern="request-response" />
    				<message-properties-transformer scope="outbound">
    					<add-message-property key="queueName" value="step2"/>
    				</message-properties-transformer>
    			
    			</inbound>
    			<outbound>
    				<pass-through-router>
    					<vm:outbound-endpoint queue="#[header:OUTBOUND:queueName]" exchange-pattern="one-way" />
    				</pass-through-router>
    			</outbound>
    			<async-reply timeout="4000">
    				<vm:inbound-endpoint queue="reply" exchange-pattern="one-way" />
    			</async-reply>
    		</service>
     
    		<service name="step2Service">
    			<inbound>
    				<vm:inbound-endpoint path="step2" exchange-pattern="one-way" />
    			</inbound>
    			<scripting:component>
    				<scripting:script engine="groovy">
    					return "step2Service";
    				</scripting:script>
    			</scripting:component>
    			<outbound>
    				<pass-through-router>
    					<vm:outbound-endpoint queue="reply" exchange-pattern="one-way" />
    				</pass-through-router>
    			</outbound>
    		</service>
    	</model>
    Show
    <model name="test">
     
    		<service name="router">
    			<inbound>
    				<vm:inbound-endpoint path="inBound" exchange-pattern="request-response" />
    				<message-properties-transformer scope="outbound">
    					<add-message-property key="queueName" value="step2"/>
    				</message-properties-transformer>
    			
    			</inbound>
    			<outbound>
    				<pass-through-router>
    					<vm:outbound-endpoint queue="#[header:OUTBOUND:queueName]" exchange-pattern="one-way" />
    				</pass-through-router>
    			</outbound>
    			<async-reply timeout="4000">
    				<vm:inbound-endpoint queue="reply" exchange-pattern="one-way" />
    			</async-reply>
    		</service>
     
    		<service name="step2Service">
    			<inbound>
    				<vm:inbound-endpoint path="step2" exchange-pattern="one-way" />
    			</inbound>
    			<scripting:component>
    				<scripting:script engine="groovy">
    					return "step2Service";
    				</scripting:script>
    			</scripting:component>
    			<outbound>
    				<pass-through-router>
    					<vm:outbound-endpoint queue="reply" exchange-pattern="one-way" />
    				</pass-through-router>
    			</outbound>
    		</service>
    	</model>
  • Similar Issues:
    None

Description

When trying to use a dynamic outbound endpoint either:

You get a null pointer exception for the VM transport "request-response" message
or
You there is no response if the VM transport is set to one-way
or
You get a null pointer exception for the JMS transport for one-way.

This seems to be down to the MuleEndpointURI class not being initialised in the FilteringOutboundRouter class.

Putting this fix in seems do make it work.

newUri.initialise();
                    return new DynamicURIOutboundEndpoint(ep, newUri);
                }
                catch (InitialisationException e) {
                    throw new CouldNotRouteOutboundMessageException(
                            CoreMessages.templateCausedMalformedEndpoint(uri, newUriString), event, ep, e);
                }

Activity

Hide
Mike Schilling added a comment -

The supplied patch was applied.

Show
Mike Schilling added a comment - The supplied patch was applied.
Hide
Peter Lenderyou added a comment -

This needs to be re-opened I think, there is a race condition in the DynamicOutboundEndpoint where the URI can get used before it's initialized.

Here

final MuleEndpointURI uri = new MuleEndpointURI(newUriString, getMuleContext());
            setEndpointURI(uri);

            getEndpointURI().initialise();
            return getEndpointURI();

I've found on a multiprocessor box that the endpoint can get used before the initialize call. possible fix that seems to work for me is.

final MuleEndpointURI uri = new MuleEndpointURI(newUriString, getMuleContext());
            
            
            uri.initialise();
            setEndpointURI(uri);

            //getEndpointURI().initialise();
            return getEndpointURI();
Show
Peter Lenderyou added a comment - This needs to be re-opened I think, there is a race condition in the DynamicOutboundEndpoint where the URI can get used before it's initialized. Here
final MuleEndpointURI uri = new MuleEndpointURI(newUriString, getMuleContext());
            setEndpointURI(uri);

            getEndpointURI().initialise();
            return getEndpointURI();
I've found on a multiprocessor box that the endpoint can get used before the initialize call. possible fix that seems to work for me is.
final MuleEndpointURI uri = new MuleEndpointURI(newUriString, getMuleContext());
            
            
            uri.initialise();
            setEndpointURI(uri);

            //getEndpointURI().initialise();
            return getEndpointURI();

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: