コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
ファイル: EmsTemplate.cs プロジェクト: fgq841103/spring-net
 public ConvertAndSendMessageCreator(EmsTemplate jmsTemplate, object message, MessagePostProcessorDelegate messagePostProcessorDelegate)
 {
     this.jmsTemplate = jmsTemplate;
     objectToConvert = message;
     this.messagePostProcessorDelegate = messagePostProcessorDelegate;
 }
コード例 #6
0
ファイル: EmsTemplate.cs プロジェクト: fgq841103/spring-net
        /// <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));

        }
コード例 #7
0
ファイル: EmsTemplate.cs プロジェクト: fgq841103/spring-net
 /// <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);
     }
 }
コード例 #8
0
 public void ConvertAndSend(string exchange, string routingKey, object message, MessagePostProcessorDelegate messagePostProcessorDelegate)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public void ConvertAndSend(object message, MessagePostProcessorDelegate messagePostProcessorDelegate)
 {
     throw new NotImplementedException();
 }