Hi all,<br><br>I'm trying to build an app using MultiService. I need to have 2 services, one that listens for UDP datagrams and another that can send those datagrams to an ActiveMQ server via a Stomp client.<br><br>I can set up the two services just fine, but I'm stuck with how to call the MQ service send method from the UDPServer instance.
<br><br>Some code to illustrate:<br><br><br><br>class GetUDP(DatagramProtocol):<br> <br> def datagramReceived(self, datagram, address):<br> print datagram,address<br> #Send datagram to the queue server
<br> # I don't know how to access the send method for the Stomp client service!<br><br><br><br>testq = internet.TCPClient(APPVARIABLES['queue_server'], int(APPVARIABLES['queue_port']), connections.StompClientFactory
(username='',password='',queue='/queue/test'))<br>testq.setName('Testq')<br>testq.setServiceParent(MQService)<br><br><br>#create a UDP listener<br>#TODO: this should be driven by the config file
<br>#reactor.listenUDP(42000, GetUDP()) <br>internet.UDPServer(42000,GetUDP()).setServiceParent(MQService)<br># Create an application as normal<br>application = service.Application("MQExample")<br><br># Connect our MultiService to the application, just like a normal service.
<br>MQService.setServiceParent(application)<br><br><br>Note: this is won't run exactly as is, but should give an idea of my problem. I've setup the ActiveMQ Stomp client as 'testq'. I've setup the UDPServer service to listen for UDP packets. I can get the UDP packets and print them, but I can't figure out how to hand them to my Stomp client's send() method. This is possible, right?
<br><br>Thanks,<br><br>Don<br>