connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-12 Thread cppdeveloper

I am trying to connect an ActiveMQ-CPP client with an Oracle OpenMQ broker
via STOMP. Both manufacturers claim this will work, and I have been able to
get an ActiveMQ-CPP client to connect to an ActiveMQ broker via STOMP, an
OpenMQ client with an OpenMQ broker via STOMP, and an OpenMQ client with an
ActiveMQ broker via STOMP without problems, but the only one missing is what
I need- ActiveMQ-CPP client to connect with OpenMQ broker. 

I am using Fedora Linux and am using the provided "example" script for
ActiveMQ-CPP, changing the brokerURL to be
"tcp://localhost:61613?wireFormat=stomp" instead, where the OpenMQ STOMP
bridge is located at localhost:61613.

On the OpenMQ end, I receive the request to connect by the client and I
start a connection:

INFO: Create JMS connection for user admin with client id
ID:csa-nexus-57767-1281630228652-1:0
Aug 12, 2010 8:23:48 AM 
INFO: Started JMS connection
8950669406784000768[ID:csa-nexus-57767-1281630228652-1:0] for user admin

This is where the ActiveMQ-CPP client hangs at "connection->start", or if
this is removed, "connection->createSession". 

Any help would be appreciated. Thanks! 
-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29420657.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-12 Thread cppdeveloper

How can I find which Frame is returned? Is this in a log somewhere? All I see
on the screen of the OpenMQ broker is: 

INFO: Create JMS connection for user admin with client id
ID:csa-nexus-54731-1281646773388-1:0
Aug 12, 2010 12:59:33 PM 
INFO: Started JMS connection
4439188484301059840[ID:csa-nexus-54731-1281646773388-1:0] for user admin

Since I sent the "admin" user/password, I know it received a request to
connect and actually started the connection. How do I find the specific
Frame, though? Thanks for your help. I am new to the JMS messaging
community. 



Timothy Bish wrote:
> 
> On Thu, 2010-08-12 at 09:35 -0700, cppdeveloper wrote:
>> I am trying to connect an ActiveMQ-CPP client with an Oracle OpenMQ
>> broker
>> via STOMP. Both manufacturers claim this will work, and I have been able
>> to
>> get an ActiveMQ-CPP client to connect to an ActiveMQ broker via STOMP, an
>> OpenMQ client with an OpenMQ broker via STOMP, and an OpenMQ client with
>> an
>> ActiveMQ broker via STOMP without problems, but the only one missing is
>> what
>> I need- ActiveMQ-CPP client to connect with OpenMQ broker. 
>> 
>> I am using Fedora Linux and am using the provided "example" script for
>> ActiveMQ-CPP, changing the brokerURL to be
>> "tcp://localhost:61613?wireFormat=stomp" instead, where the OpenMQ STOMP
>> bridge is located at localhost:61613.
>> 
>> On the OpenMQ end, I receive the request to connect by the client and I
>> start a connection:
>> 
>> INFO: Create JMS connection for user admin with client id
>> ID:csa-nexus-57767-1281630228652-1:0
>> Aug 12, 2010 8:23:48 AM 
>> INFO: Started JMS connection
>> 8950669406784000768[ID:csa-nexus-57767-1281630228652-1:0] for user admin
>> 
> 
> What is the Frame returned from the OpenMQ broker once it receives the
> CONNECT frame?
> 
>> This is where the ActiveMQ-CPP client hangs at "connection->start", or if
>> this is removed, "connection->createSession". 
>> 
>> Any help would be appreciated. Thanks! 
> 
> Regards
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29423147.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-12 Thread cppdeveloper


Timothy Bish wrote:
> 
> You can append this option to the connection URI to get the Commands
> that are sent and received logged to the console:
> 
> transport.commandTracingEnabled=true
> 
> I Don't know how to configure that on the OpenMQ side.
> 
> Regards
> 

When I did this to the ActiveMQ-CPP client, I saw the following output
before it hung: 

SEND: ConnectionInfo { commandId = 1, responseRequired = true, ConnectionId
= ID:csa-nexus-43500-1281649512267-0:0, ClientId =
ID:csa-nexus-43500-1281649512267-1:0, Password = admin, UserName = admin,
BrokerPath = NULL, BrokerMasterConnector = false, Manageable = false,
ClientMaster = false, FaultTolerant = false }

I am in the process of figuring out how to see OpenMQ's Frames
sent/received. From this, I am guessing that the connection info was sent,
and OpenMQ clearly received it and opened the connection for them, but
somehow ActiveMQ-CPP is not receiving a response, so it doesn't know it is
okay to send and thus hangs forever. 
-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29423353.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-16 Thread cppdeveloper

>From debugging the StompWireFormat class, I see that the CONNECT frame is
marshalled and sent from ActiveMQ-CPP to the OpenMQ broker, and OpenMQ
starts the connection and send back a frame to the ActiveMQ-CPP client. Then
the StompWireFormat class tries to unmarshal the message in the function:

Pointer StompWireFormat::unmarshalConnected( const
Pointer& frame ) {

Pointer response( new Response() );
if( frame->hasProperty( StompCommandConstants::HEADER_RESPONSEID ) ) {

response->setCorrelationId( Integer::parseInt(
frame->getProperty( StompCommandConstants::HEADER_RESPONSEID ) )
);
} else {

throw IOException(
__FILE__, __LINE__, "Error, Connected Command has no Response
ID." );
}

return response;
}


The function enters the "else" statement, meaning it does not recognize the
frame, and throws the exception (however, this hangs and is never printed to
the screen). 

Is there anything that can be done here or is there no hope of being able to
use OpenMQ with the ActiveMQ-CPP client?

Thanks. 



Timothy Bish wrote:
> 
> On Thu, 2010-08-12 at 14:14 -0700, cppdeveloper wrote:
>> 
>> Timothy Bish wrote:
>> > 
>> > You can append this option to the connection URI to get the Commands
>> > that are sent and received logged to the console:
>> > 
>> > transport.commandTracingEnabled=true
>> > 
>> > I Don't know how to configure that on the OpenMQ side.
>> > 
>> > Regards
>> > 
>> 
>> When I did this to the ActiveMQ-CPP client, I saw the following output
>> before it hung: 
>> 
>> SEND: ConnectionInfo { commandId = 1, responseRequired = true,
>> ConnectionId
>> = ID:csa-nexus-43500-1281649512267-0:0, ClientId =
>> ID:csa-nexus-43500-1281649512267-1:0, Password = admin, UserName = admin,
>> BrokerPath = NULL, BrokerMasterConnector = false, Manageable = false,
>> ClientMaster = false, FaultTolerant = false }
>> 
>> I am in the process of figuring out how to see OpenMQ's Frames
>> sent/received. From this, I am guessing that the connection info was
>> sent,
>> and OpenMQ clearly received it and opened the connection for them, but
>> somehow ActiveMQ-CPP is not receiving a response, so it doesn't know it
>> is
>> okay to send and thus hangs forever. 
> 
> 
> You might need to debug the StompWireFormat class to see what is getting
> marshaled and unmarshaled.  The Command logging only gets you so far, if
> there's a frame coming in that we don't know how to unmarshal it could
> be failing in there, although it should have thrown an exception.
> 
> Regards
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29449176.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-18 Thread cppdeveloper



Timothy Bish wrote:
> 
> Can you add some code to dump the contents of the Response frame sent
> from OpenMQ?  This would help me understand why its not being
> processed.  
> 

According to an OpenMQ developer, he thought the problem may be this:

"IIRC the Stomp frames in OpenMQ always use a content-length header while
ActiveMQ uses this header for binary messages only, and uses a null byte
terminator for text messages.
So I think that the ActiveMQ Stomp library times out because if waits for
the null byte, which never is sent from the OpenMQ broker.
Hope this helps,
Michael"

Other than adjusting the output from the OpenMQ broker, is there any way to
change how the ActiveMQ-CPP client handles this? 


Timothy Bish wrote:
> 
> Can I ask why you need to use ActiveMQ-CPP to talk stomp to OpenMQ,
> don't they have a C client for OpenMQ?
> 

We already have an exisitng broker cluster of OpenMQ brokers, and we need a
C++ client to interact with them, but we also need it to use failover, which
their C client does not. Thus far, ActiveMQ-CPP has seemed like the best
open source option, if they could connect/communicate correctly!

-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29472714.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



How to use ActiveMQ in Glassfish

2010-08-18 Thread cppdeveloper

I am trying to use ActiveMQ 5.3.2 in Oracle Glassfish 2.1.1 and the
instructions I found are:
http://activemq.apache.org/sjsas-with-genericjmsra.html. 

Is there any easier/less complicated way of configuring ActiveMQ to work in
Glassfish? Or more thorough instructions?
-- 
View this message in context: 
http://old.nabble.com/How-to-use-ActiveMQ-in-Glassfish-tp29472771p29472771.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: ActiveMQ 5 to Glassfish v2 integration, BPEL

2010-08-18 Thread cppdeveloper

Did anyone ever get this working- ActiveMQ 5 integrated with Glassfish V2?



lyall wrote:
> 
> I want to integrate ActiveMQ with Glassfish v2 such that I can post and
> receive messages from BPEL.
> 
> I found  
> http://weblogs.java.net/blog/rampsarathy/archive/2007/03/glassfish_v2_an.html 
> http://weblogs.java.net/blog/rampsarathy/archive/2007/03/glassfish_v2_an.html 
> which was listed in  http://activemq.apache.org/articles.html
> http://activemq.apache.org/articles.html  but this is for an older version
> of ActiveMQ and jars don't exist, as described. I also figure that many of
> the steps are probably doable via the web admin console.
> 
> Is there a more recent 'howto' I can setup ActiveMQ.
> 
> Also, I am new to Netbeans IDE so would appreciate a guide on using JMS
> from within BPEL, once ActiveMQ is integrated.
> 
> Any assistance would be greatly appreciated.
> 

-- 
View this message in context: 
http://old.nabble.com/ActiveMQ-5-to-Glassfish-v2-integration%2C-BPEL-tp22518992p29473132.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-18 Thread cppdeveloper

Failover is crucial, so I will have to use my backup method, which is
converting the broker cluster from OpenMQ to ActiveMQ 5, but it still needs
to work in Glassfish V2.

FYI I have done some pretty thorough research on OpenMQ and
ActiveMQ/ActiveMQ-CPP about STOMP and failover and I never saw it written
anywhere that both would not be supported simultaneously. It would probably
be a good idea to write that somewhere so people don't spend days trying to
configure something that will never work anyways. 

Thanks for the heads up. 


Timothy Bish wrote:
> 
> On Wed, 2010-08-18 at 08:35 -0700, cppdeveloper wrote:
>> 
>> 
>> Timothy Bish wrote:
>> > 
>> > Can you add some code to dump the contents of the Response frame sent
>> > from OpenMQ?  This would help me understand why its not being
>> > processed.  
>> > 
>> 
>> According to an OpenMQ developer, he thought the problem may be this:
>> 
>> "IIRC the Stomp frames in OpenMQ always use a content-length header while
>> ActiveMQ uses this header for binary messages only, and uses a null byte
>> terminator for text messages.
>> So I think that the ActiveMQ Stomp library times out because if waits for
>> the null byte, which never is sent from the OpenMQ broker.
>> Hope this helps,
>> Michael"
>> 
>> Other than adjusting the output from the OpenMQ broker, is there any way
>> to
>> change how the ActiveMQ-CPP client handles this? 
> 
> Since its hanging during the Connect phase then the content-length
> property wouldn't come into play here since you aren't at the point of
> even sending or receive Stomp Send / Message Frames, the exchange at
> this point would either be the Connect / Connected exchange or a
> Subscribe if you are getting to the point of actually creating a
> Consumer.
> 
> The content-length is optional in Stomp 1.0 for Send / Message frames
> and the frame must end in a newline either way so in that regards AMQCPP
> is stomp compliant.  
> 
>> 
>> 
>> Timothy Bish wrote:
>> > 
>> > Can I ask why you need to use ActiveMQ-CPP to talk stomp to OpenMQ,
>> > don't they have a C client for OpenMQ?
>> > 
>> 
>> We already have an exisitng broker cluster of OpenMQ brokers, and we need
>> a
>> C++ client to interact with them, but we also need it to use failover,
>> which
>> their C client does not. Thus far, ActiveMQ-CPP has seemed like the best
>> open source option, if they could connect/communicate correctly!
>> 
> 
> You won't be able to use the Failover Transport with the Stomp transport
> as Stomp doesn't support a reliability mechanism for connection
> monitoring nor does it allow for subscription recovery so the Failover
> support in AMQCPP isn't going to work when you are connected to Stomp.
> 
> 
> Regards
> 
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29473160.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: connection->start() or connection->createSession() hangs when trying to connect ActiveMQ-CPP client with OpenMQ broker via STOMP

2010-08-18 Thread cppdeveloper

That makes sense- being new to JMS in general, that will be really help on
the Wiki. Thanks. 

I'll be configuring ActiveMQ with ActiveMQ-CPP in Glassfish, so I can use
openwire which I read is more reliable and has more capabilities anyway. 

Thanks!


Timothy Bish wrote:
> 
> On Wed, 2010-08-18 at 09:16 -0700, cppdeveloper wrote:
>> Failover is crucial, so I will have to use my backup method, which is
>> converting the broker cluster from OpenMQ to ActiveMQ 5, but it still
>> needs
>> to work in Glassfish V2.
>> 
>> FYI I have done some pretty thorough research on OpenMQ and
>> ActiveMQ/ActiveMQ-CPP about STOMP and failover and I never saw it written
>> anywhere that both would not be supported simultaneously. It would
>> probably
>> be a good idea to write that somewhere so people don't spend days trying
>> to
>> configure something that will never work anyways. 
> 
> I updated the Wiki to reflect the advice not to combine Stomp and
> Failover.  
> 
> Stomp is a pretty basic protocol and as such there are limits to what
> can be done with it, you could implement some basic failover using the
> current v1.0 spec in ActiveMQ-CPP but it would have its limits.  Until
> the v1.1 Stomp spec is ratified its hard to detect in most cases that
> the tcp connection has been broken as there are no KeepAlive messages
> between broker and client.  
> 
>> 
>> Thanks for the heads up. 
>> 
>> 
>> Timothy Bish wrote:
>> > 
>> > On Wed, 2010-08-18 at 08:35 -0700, cppdeveloper wrote:
>> >> 
>> >> 
>> >> Timothy Bish wrote:
>> >> > 
>> >> > Can you add some code to dump the contents of the Response frame
>> sent
>> >> > from OpenMQ?  This would help me understand why its not being
>> >> > processed.  
>> >> > 
>> >> 
>> >> According to an OpenMQ developer, he thought the problem may be this:
>> >> 
>> >> "IIRC the Stomp frames in OpenMQ always use a content-length header
>> while
>> >> ActiveMQ uses this header for binary messages only, and uses a null
>> byte
>> >> terminator for text messages.
>> >> So I think that the ActiveMQ Stomp library times out because if waits
>> for
>> >> the null byte, which never is sent from the OpenMQ broker.
>> >> Hope this helps,
>> >> Michael"
>> >> 
>> >> Other than adjusting the output from the OpenMQ broker, is there any
>> way
>> >> to
>> >> change how the ActiveMQ-CPP client handles this? 
>> > 
>> > Since its hanging during the Connect phase then the content-length
>> > property wouldn't come into play here since you aren't at the point of
>> > even sending or receive Stomp Send / Message Frames, the exchange at
>> > this point would either be the Connect / Connected exchange or a
>> > Subscribe if you are getting to the point of actually creating a
>> > Consumer.
>> > 
>> > The content-length is optional in Stomp 1.0 for Send / Message frames
>> > and the frame must end in a newline either way so in that regards
>> AMQCPP
>> > is stomp compliant.  
>> > 
>> >> 
>> >> 
>> >> Timothy Bish wrote:
>> >> > 
>> >> > Can I ask why you need to use ActiveMQ-CPP to talk stomp to OpenMQ,
>> >> > don't they have a C client for OpenMQ?
>> >> > 
>> >> 
>> >> We already have an exisitng broker cluster of OpenMQ brokers, and we
>> need
>> >> a
>> >> C++ client to interact with them, but we also need it to use failover,
>> >> which
>> >> their C client does not. Thus far, ActiveMQ-CPP has seemed like the
>> best
>> >> open source option, if they could connect/communicate correctly!
>> >> 
>> > 
>> > You won't be able to use the Failover Transport with the Stomp
>> transport
>> > as Stomp doesn't support a reliability mechanism for connection
>> > monitoring nor does it allow for subscription recovery so the Failover
>> > support in AMQCPP isn't going to work when you are connected to Stomp.
>> > 
>> > 
>> > Regards
>> > 
>> > 
>> > -- 
>> > Tim Bish
>> > 
>> > Open Source Integration: http://fusesource.com
>> > ActiveMQ in Action: http://www.manning.com/snyder/
>> > 
>> > Follow me on Twitter: http://twitter.com/tabish121
>> > My Blog: http://timbish.blogspot.com/
>> > 
>> > 
>> > 
>> 
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/connection-%3Estart%28%29-or-connection-%3EcreateSession%28%29-hangs-when-trying-to-connect-ActiveMQ-CPP-client-with-OpenMQ-broker-via-STOMP-tp29420657p29474508.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.