/// <summary> /// Send the given object to the specified destination, converting the object /// to a MSMQ message with a configured <see cref="IMessageConverter"/> and resolving the /// destination name to a <see cref="MessageQueue"/> with an <see cref="IMessageQueueFactory"/> /// The <see cref="MessagePostProcessorDelegate"/> callback allows for modification of the message after conversion. /// </summary> /// <param name="messageQueueObjectName">the name of the destination queue /// to send this message to (to be resolved to an actual MessageQueue /// by a IMessageQueueFactory)</param> /// <param name="obj">the object to convert to a message</param> /// <param name="messagePostProcessorDelegate">the callback to modify the message</param> /// <exception cref="MessagingException">if thrown by MSMQ API methods</exception> public void ConvertAndSend(string messageQueueObjectName, object obj, MessagePostProcessorDelegate messagePostProcessorDelegate) { Message msg = MessageConverter.ToMessage(obj); Message msgToSend = messagePostProcessorDelegate(msg); Send(MessageQueueFactory.CreateMessageQueue(messageQueueObjectName), msgToSend); }
/// <summary> /// Send the given object to the default destination, converting the object /// to a MSMQ message with a configured IMessageConverter. The IMessagePostProcessor /// callback allows for modification of the message after conversion. /// <p>This will only work with a default destination specified!</p> /// </summary> /// <param name="obj">the object to convert to a message</param> /// <param name="messagePostProcessorDelegate">the callback to modify the message</param> /// <exception cref="MessagingException">if thrown by MSMQ API methods</exception> public void ConvertAndSend(object obj, MessagePostProcessorDelegate messagePostProcessorDelegate) { CheckDefaultMessageQueue(); ConvertAndSend(DefaultMessageQueueObjectName, obj, messagePostProcessorDelegate); }
public ConvertAndSendMessageCreator(EmsTemplate jmsTemplate, object message, MessagePostProcessorDelegate messagePostProcessorDelegate) { this.jmsTemplate = jmsTemplate; objectToConvert = message; this.messagePostProcessorDelegate = messagePostProcessorDelegate; }
/// <summary> /// Send the given object to the specified destination, converting the object /// to a EMS message with a configured IMessageConverter. The IMessagePostProcessor /// callback allows for modification of the message after conversion. /// </summary> /// <param name="destinationName">the name of the destination to send this message to /// (to be resolved to an actual destination by a DestinationResolver)</param> /// <param name="message">the object to convert to a message.</param> /// <param name="postProcessor">the callback to modify the message</param> /// <exception cref="EMSException">If there is any problem accessing the EMS API</exception> public void ConvertAndSendWithDelegate(string destinationName, object message, MessagePostProcessorDelegate postProcessor) { CheckMessageConverter(); Send(destinationName, new ConvertAndSendMessageCreator(this, message, postProcessor)); }
/// <summary> /// Send the given object to the default destination, converting the object /// to a EMS message with a configured IMessageConverter. The IMessagePostProcessor /// callback allows for modification of the message after conversion. /// <p>This will only work with a default destination specified!</p> /// </summary> /// <param name="message">the object to convert to a message</param> /// <param name="postProcessor">the callback to modify the message</param> /// <exception cref="EMSException">If there is any problem accessing the EMS API</exception> public void ConvertAndSendWithDelegate(object message, MessagePostProcessorDelegate postProcessor) { //Execute(new SendDestinationCallback(this, destination, messageCreatorDelegate), false); CheckDefaultDestination(); if (DefaultDestination != null) { ConvertAndSendWithDelegate(DefaultDestination, message, postProcessor); } else { ConvertAndSendWithDelegate(DefaultDestinationName, message, postProcessor); } }
public void ConvertAndSend(string exchange, string routingKey, object message, MessagePostProcessorDelegate messagePostProcessorDelegate) { throw new NotImplementedException(); }
public void ConvertAndSend(object message, MessagePostProcessorDelegate messagePostProcessorDelegate) { throw new NotImplementedException(); }