public void enviarObjeto(Mensaje m) { Console.WriteLine(_producer.CreateXmlMessage(m).Text); Console.ReadKey(); try { _producer.Send(m); } catch (System.NullReferenceException ex) { Console.WriteLine("No se ha podido inicializar el productor. Compruebe que ApacheMQ esté encendido."); Console.ReadKey(); } }
/// <summary> /// Sends the message to the given destination with the explicit QoS configuration. The object must be serializable to XML. /// </summary> public static void Send(this IMessageProducer producer, IDestination destination, object objMessage, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive) { producer.Send(destination, producer.CreateXmlMessage(objMessage), deliveryMode, priority, timeToLive); }
/// <summary> /// Sends the message to the given destination /// </summary> public static void Send(this IMessageProducer producer, IDestination destination, object objMessage, Encoding encoding) { producer.Send(destination, producer.CreateXmlMessage(objMessage, encoding)); }
/// <summary> /// Sends the message to the default destination with the explicit QoS configuration. The object must be serializable to XML. /// </summary> public static void Send(this IMessageProducer producer, object objMessage, Encoding encoding, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive) { producer.Send(producer.CreateXmlMessage(objMessage, encoding), deliveryMode, priority, timeToLive); }
/// <summary> /// Sends the message to the default destination for this producer. The object must be serializable to XML. /// </summary> public static void Send(this IMessageProducer producer, object objMessage, Encoding encoding) { producer.Send(producer.CreateXmlMessage(objMessage, encoding)); }
/// <summary> /// Sends the message to the default destination for this producer. The object must be serializable to XML. /// </summary> public static void Send(this IMessageProducer producer, object objMessage) { producer.Send(producer.CreateXmlMessage(objMessage)); }