A java client would typically use openwire over tcp, not stomp. There is some support for a java api : see http://activemq.apache.org/stomp.html#Stomp-JavaAPI and some more work has been done on trunk for 5.3 but it is mainly used for junit testing the stomp connector.
2009/6/17 Robert Schultz <rob...@cosmicrealms.com> > > So I have an ActiveMQ server working just great. I can connect to it via > python and send and receive messages over topics, no problems. > > But now I'm trying to create a Java program that will consume messages. > Whenever it gets to connection.createSession the program hangs up forever. > > The code: > ActiveMQConnectionFactory connectionFactory = new > ActiveMQConnectionFactory(); > connectionFactory.setUserName("theUsername"); > connectionFactory.setPassword("thePassword"); > connectionFactory.setBrokerURL("stomp://my.server.com:61613"); > > Connection connection = connectionFactory.createConnection(); > Session session = connection.createSession(false, > Session.SESSION_TRANSACTED); > > > I've tried several different things including specific topicConnections, > etc. > None of them work, once it hits createSession it hangs forever. > > If I pause the running process here is the stack trace: > Unsafe.park(boolean, long) line: not available [native method] [local > variables unavailable] > LockSupport.park(Object) line: 158 > AbstractQueuedSynchronizer$ConditionObject.await() line: 1925 > ArrayBlockingQueue<E>.take() line: 317 > FutureResponse.getResult() line: 40 > ResponseCorrelator.request(Object) line: 80 > ActiveMQConnection.syncSendPacket(Command) line: 1233 > ActiveMQConnection.ensureConnectionInfoSent() line: 1339 > ActiveMQConnection.createSession(boolean, int) line: 298 > > > The active MQ thread has: > SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: > not available [native method] > SocketInputStream.read(byte[], int, int) line: 129 > TcpBufferedInputStream.fill() line: 50 > TcpBufferedInputStream.read() line: 58 > DataInputStream.readByte() line: 248 > StompWireFormat.readLine(DataInput, int, String) line: 186 > StompWireFormat.unmarshal(DataInput) line: 94 > TcpTransport.readCommand() line: 210 > TcpTransport.doRun() line: 202 > TcpTransport.run() line: 185 > Thread.run() line: 619 [local variables unavailable] > > Anyone have any ideas on what I can do? > > I'm running Stomp 5.2.0 on a Linux machine with Java 1.6 > > I'd appreciate any and all help/advice/tips! > -- > View this message in context: > http://www.nabble.com/connection.createSession-hangs-up-tp24064922p24064922.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source Integration http://fusesource.com