// This enpoint needs to be registered prior to use cause we need to set
// the transaction config so that the endpoint will "know" it is transacted
// and not close the session itself but leave it up to the transaction.
EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder(
new URIBuilder("jms://test.queue", muleContext));
endpointBuilder.setTransactionConfig(tc);
endpointBuilder.setName("TransactedTest.Queue");
ImmutableEndpoint inboundEndpoint = muleContext.getEndpointFactory()
.getOutboundEndpoint(endpointBuilder);
client.getMuleContext().getRegistry().registerEndpoint(inboundEndpoint);