public static void addToTopic(Venta v) { publisher = new TopicPublisher(TOPIC_NAME, BROKER); var javaScriptSerializer = new JavaScriptSerializer(); String item = javaScriptSerializer.Serialize(v); publisher.SendMessage(item); }
public void broadcastPuja(Puja p) { const string TOPIC_NAME = "Pujas"; const string BROKER = "tcp://localhost:61616"; TopicPublisher publisher; publisher = new TopicPublisher(TOPIC_NAME, BROKER); var javaScriptSerializer = new JavaScriptSerializer(); String item = javaScriptSerializer.Serialize(p); publisher.SendMessage(item); }
public void informarVentaFinalizada(Venta v, Usuario comprador) { //Informar a los pujadores de la venta finalizada (TOPIC) const string TOPIC_NAME = "Ventas"; const string BROKER = "tcp://localhost:61616"; TopicPublisher publisher; publisher = new TopicPublisher(TOPIC_NAME, BROKER); v.comprador = comprador.Nombre; var javaScriptSerializer = new JavaScriptSerializer(); String item = javaScriptSerializer.Serialize(v); //Debug.WriteLine(item); publisher.SendMessage(item); }