public void ConvertAndSend() { Assert.NotNull(connectionFactory); Assert.NotNull(nmsTemplate); string msgText = "Hello World"; //Use with destination set at runtime nmsTemplate.ConvertAndSend("APP.TESTING", msgText); AssertRecievedHelloWorldMessage(msgText, nmsTemplate.ReceiveAndConvert("APP.TESTING")); //Now using default destination set via property nmsTemplate.DefaultDestinationName = "APP.TESTING"; nmsTemplate.ConvertAndSend(msgText); AssertRecievedHelloWorldMessage(msgText, nmsTemplate.ReceiveAndConvert()); }
public IMessage Receive() { object receivedObject = NmsTemplate.ReceiveAndConvert(); if (receivedObject == null) { return(null); } if (receivedObject is IMessage) { return((IMessage)receivedObject); } return(new Spring.Integration.Message.Message(receivedObject)); }