How can I connect drupal 6 and activemq?
If you're willing to upgrade to Drupal 7, Services version 3 should interface to (for instance) JSON or SOAP.

Feature of version 3:


  
  Response format API allows you to define response Formats for CONTENT-TYPE ie. application/json or application/xml.
  


Edit: I didn't know about STOMP, which the OP mentions in a comment. I add it here for searches/future reference:


  STOMP is the Simple (or Streaming) Text Orientated Messaging Protocol. The Stomp module implements an alternative Drupal Queue backend for queues supporting the STOMP protocol - such as ActiveMQ, RabbitMQ.


For Drupal 6, there is JSON server.  I am not familiar with it, but you may be able to use that instead.