You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Indika Sampath <in...@gmail.com> on 2016/03/09 13:18:17 UTC

[Help] Debug qpid code

Hi All,

I forked qpid [1] and studying the implementation. I was create Jmeter
scripts to publish and subscribe. Those are working fine. So I started to
identify message publishing flow. I am using Intellij Idea community
edition version 15. Project imported to Intellij Idea correctly. Next I set
debug config which is transport to socket and port to 8000. Then start
broker with ./qpid-server -run:jpda.

I added break point to line inside deliverCurrentMessageIfComplete() method
in AMQChannel. But when I hit the broker by publisher, debug point not
getting executed. Could you please point out correct way of debug code and
identify message publishing flow.

[1] https://github.com/apache/qpid-java

Cheers!

Re: [Help] Debug qpid code

Posted by Indika Sampath <in...@gmail.com>.
Hi Rob,

I was able to debug AMQP 0-10 message publishing flow with given
instructions. I really appreciate your help. :-)

Cheers!

On Thu, Mar 10, 2016 at 12:17 PM, Rob Godfrey <ro...@gmail.com>
wrote:

> So given the above settings I *think* you are using the qpid-client which
> is bundled in the Qpid Java release.  This client speaks AMQP 0-8/0-9/0-9-1
> and 0-10.  There is a separate qpid-jms client which speaks AMQP 1.0.  By
> default the client will connect using the most recent version of the
> protocol that both client and broker support - which in your case would be
> AMQP 0-10.  This being the case, the control flow will never go through
> AMQChannel.  The equivalent point in the 0-10 flow would be
> org.apache.qpid.server.protocol.v0_10.ServerSession#enqueue(...)
>
> Hope this helps,
> Rob
>
> On 10 March 2016 at 03:28, Indika Sampath <in...@gmail.com>
> wrote:
>
>> Hi Lorenz,
>>
>> Thanks for the alternative approach. I am also not quite sure why -run:jpda
>> not working correctly. I'll further give a try to figure it out.
>>
>> Hi Rob,
>> I didn't specify AMQP protocol version. I am using Apache Jmeter to
>> publish and subscribe. Below are the basic properties set in the Jmeter
>> script.
>>
>> jms.initial_context_factory -
>> org.apache.qpid.jndi.PropertiesFileInitialContextFactory
>> jms.provider_url - path to .jndi property file which has connection
>> factory and queue name key value pair
>> jms.connection_factory - qpidConnectionfactory
>>
>> Do I need to explicitly set AMQP protocol version? If I didn't set it,
>> then what would be set as default? Could you please let me know how to set
>> it up?
>>
>> Cheers!
>>
>> On Wed, Mar 9, 2016 at 8:01 PM, Rob Godfrey <ro...@gmail.com>
>> wrote:
>>
>>> Which version of the AMQP protocol are you using to publish your
>>> messages?
>>>
>>> AMQChannel is only used for the 0-8, 0-9, and 0-9-1 protocols.
>>> If you are using AMQP 0-10 or AMQP 1.0 your breakpoint will never be hit.
>>>
>>> Cheers,
>>> Rob
>>>
>>> On 9 March 2016 at 12:18, Indika Sampath <in...@gmail.com>
>>> wrote:
>>>
>>> > Hi All,
>>> >
>>> > I forked qpid [1] and studying the implementation. I was create Jmeter
>>> > scripts to publish and subscribe. Those are working fine. So I started
>>> to
>>> > identify message publishing flow. I am using Intellij Idea community
>>> > edition version 15. Project imported to Intellij Idea correctly. Next
>>> I set
>>> > debug config which is transport to socket and port to 8000. Then start
>>> > broker with ./qpid-server -run:jpda.
>>> >
>>> > I added break point to line inside deliverCurrentMessageIfComplete()
>>> method
>>> > in AMQChannel. But when I hit the broker by publisher, debug point not
>>> > getting executed. Could you please point out correct way of debug code
>>> and
>>> > identify message publishing flow.
>>> >
>>> > [1] https://github.com/apache/qpid-java
>>> >
>>> > Cheers!
>>> >
>>>
>>
>>
>

Re: [Help] Debug qpid code

Posted by Rob Godfrey <ro...@gmail.com>.
So given the above settings I *think* you are using the qpid-client which
is bundled in the Qpid Java release.  This client speaks AMQP 0-8/0-9/0-9-1
and 0-10.  There is a separate qpid-jms client which speaks AMQP 1.0.  By
default the client will connect using the most recent version of the
protocol that both client and broker support - which in your case would be
AMQP 0-10.  This being the case, the control flow will never go through
AMQChannel.  The equivalent point in the 0-10 flow would be
org.apache.qpid.server.protocol.v0_10.ServerSession#enqueue(...)

Hope this helps,
Rob

On 10 March 2016 at 03:28, Indika Sampath <in...@gmail.com>
wrote:

> Hi Lorenz,
>
> Thanks for the alternative approach. I am also not quite sure why -run:jpda
> not working correctly. I'll further give a try to figure it out.
>
> Hi Rob,
> I didn't specify AMQP protocol version. I am using Apache Jmeter to
> publish and subscribe. Below are the basic properties set in the Jmeter
> script.
>
> jms.initial_context_factory -
> org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> jms.provider_url - path to .jndi property file which has connection
> factory and queue name key value pair
> jms.connection_factory - qpidConnectionfactory
>
> Do I need to explicitly set AMQP protocol version? If I didn't set it,
> then what would be set as default? Could you please let me know how to set
> it up?
>
> Cheers!
>
> On Wed, Mar 9, 2016 at 8:01 PM, Rob Godfrey <ro...@gmail.com>
> wrote:
>
>> Which version of the AMQP protocol are you using to publish your messages?
>>
>> AMQChannel is only used for the 0-8, 0-9, and 0-9-1 protocols.
>> If you are using AMQP 0-10 or AMQP 1.0 your breakpoint will never be hit.
>>
>> Cheers,
>> Rob
>>
>> On 9 March 2016 at 12:18, Indika Sampath <in...@gmail.com>
>> wrote:
>>
>> > Hi All,
>> >
>> > I forked qpid [1] and studying the implementation. I was create Jmeter
>> > scripts to publish and subscribe. Those are working fine. So I started
>> to
>> > identify message publishing flow. I am using Intellij Idea community
>> > edition version 15. Project imported to Intellij Idea correctly. Next I
>> set
>> > debug config which is transport to socket and port to 8000. Then start
>> > broker with ./qpid-server -run:jpda.
>> >
>> > I added break point to line inside deliverCurrentMessageIfComplete()
>> method
>> > in AMQChannel. But when I hit the broker by publisher, debug point not
>> > getting executed. Could you please point out correct way of debug code
>> and
>> > identify message publishing flow.
>> >
>> > [1] https://github.com/apache/qpid-java
>> >
>> > Cheers!
>> >
>>
>
>

Re: [Help] Debug qpid code

Posted by Indika Sampath <in...@gmail.com>.
Hi Lorenz,

Thanks for the alternative approach. I am also not quite sure why -run:jpda
not working correctly. I'll further give a try to figure it out.

Hi Rob,
I didn't specify AMQP protocol version. I am using Apache Jmeter to publish
and subscribe. Below are the basic properties set in the Jmeter script.

jms.initial_context_factory -
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
jms.provider_url - path to .jndi property file which has connection factory
and queue name key value pair
jms.connection_factory - qpidConnectionfactory

Do I need to explicitly set AMQP protocol version? If I didn't set it, then
what would be set as default? Could you please let me know how to set it up?

Cheers!

On Wed, Mar 9, 2016 at 8:01 PM, Rob Godfrey <ro...@gmail.com> wrote:

> Which version of the AMQP protocol are you using to publish your messages?
>
> AMQChannel is only used for the 0-8, 0-9, and 0-9-1 protocols.
> If you are using AMQP 0-10 or AMQP 1.0 your breakpoint will never be hit.
>
> Cheers,
> Rob
>
> On 9 March 2016 at 12:18, Indika Sampath <in...@gmail.com>
> wrote:
>
> > Hi All,
> >
> > I forked qpid [1] and studying the implementation. I was create Jmeter
> > scripts to publish and subscribe. Those are working fine. So I started to
> > identify message publishing flow. I am using Intellij Idea community
> > edition version 15. Project imported to Intellij Idea correctly. Next I
> set
> > debug config which is transport to socket and port to 8000. Then start
> > broker with ./qpid-server -run:jpda.
> >
> > I added break point to line inside deliverCurrentMessageIfComplete()
> method
> > in AMQChannel. But when I hit the broker by publisher, debug point not
> > getting executed. Could you please point out correct way of debug code
> and
> > identify message publishing flow.
> >
> > [1] https://github.com/apache/qpid-java
> >
> > Cheers!
> >
>

Re: [Help] Debug qpid code

Posted by Rob Godfrey <ro...@gmail.com>.
Which version of the AMQP protocol are you using to publish your messages?

AMQChannel is only used for the 0-8, 0-9, and 0-9-1 protocols.
If you are using AMQP 0-10 or AMQP 1.0 your breakpoint will never be hit.

Cheers,
Rob

On 9 March 2016 at 12:18, Indika Sampath <in...@gmail.com>
wrote:

> Hi All,
>
> I forked qpid [1] and studying the implementation. I was create Jmeter
> scripts to publish and subscribe. Those are working fine. So I started to
> identify message publishing flow. I am using Intellij Idea community
> edition version 15. Project imported to Intellij Idea correctly. Next I set
> debug config which is transport to socket and port to 8000. Then start
> broker with ./qpid-server -run:jpda.
>
> I added break point to line inside deliverCurrentMessageIfComplete() method
> in AMQChannel. But when I hit the broker by publisher, debug point not
> getting executed. Could you please point out correct way of debug code and
> identify message publishing flow.
>
> [1] https://github.com/apache/qpid-java
>
> Cheers!
>

Re: [Help] Debug qpid code

Posted by Lorenz Quack <qu...@gmail.com>.
Hi again,

Today I learned about the remote debugging capabilities with -run:jpda. 
I did not know that before. Sorry.
So consider my previous email as an alternative approach.
Why your approach did not work I don't know because I am not familiar 
with it. Sorry.

Kind Regards,
Lorenz


On 09/03/16 13:10, Lorenz Quack wrote:
> Hi,
>
> If I understand correctly you try to set a break point in IntelliJ but 
> start the broker from the command line using the qpid-server script.
> That won't work because IntelliJ won't know anything about the running 
> broker.
>
> To use IntelliJ for debugging you need to start the program you want 
> to debug from within IntelliJ.
> You can set this up in the "Run -> Edit Configurations..." menu.
> Add a new Application and use the org.apache.qpid.server.Main class ad 
> "Main class".
> in the VM options you should specify "-DQPID_HOME=... -DQPID_WORK=..." 
> (obviously replace the ... with paths on your machine)
> The working directoy should be the base directory of the project 
> (where the top level pom.xml is located).
> make sure to set "Use classpath of module" to "qpid-broker".
> Also you need to set the JRE to at least 1.7.
>
> That should get the broker started and you should be able to use the 
> IntelliJ debugger.
>
> One more thing, if you want to use the Web management console you will 
> have to also specify dojo as a dependency for the "qpid-broker" module 
> in the "File -> Project Structure..." menu.
>
> Hope that helps.
>
> Kind regards,
> Lorenz
>
>
> On 09/03/16 12:18, Indika Sampath wrote:
>> Hi All,
>>
>> I forked qpid [1] and studying the implementation. I was create Jmeter
>> scripts to publish and subscribe. Those are working fine. So I 
>> started to
>> identify message publishing flow. I am using Intellij Idea community
>> edition version 15. Project imported to Intellij Idea correctly. Next 
>> I set
>> debug config which is transport to socket and port to 8000. Then start
>> broker with ./qpid-server -run:jpda.
>>
>> I added break point to line inside deliverCurrentMessageIfComplete() 
>> method
>> in AMQChannel. But when I hit the broker by publisher, debug point not
>> getting executed. Could you please point out correct way of debug 
>> code and
>> identify message publishing flow.
>>
>> [1] https://github.com/apache/qpid-java
>>
>> Cheers!
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Re: [Help] Debug qpid code

Posted by Lorenz Quack <qu...@gmail.com>.
Hi,

If I understand correctly you try to set a break point in IntelliJ but 
start the broker from the command line using the qpid-server script.
That won't work because IntelliJ won't know anything about the running 
broker.

To use IntelliJ for debugging you need to start the program you want to 
debug from within IntelliJ.
You can set this up in the "Run -> Edit Configurations..." menu.
Add a new Application and use the org.apache.qpid.server.Main class ad 
"Main class".
in the VM options you should specify "-DQPID_HOME=... -DQPID_WORK=..." 
(obviously replace the ... with paths on your machine)
The working directoy should be the base directory of the project (where 
the top level pom.xml is located).
make sure to set "Use classpath of module" to "qpid-broker".
Also you need to set the JRE to at least 1.7.

That should get the broker started and you should be able to use the 
IntelliJ debugger.

One more thing, if you want to use the Web management console you will 
have to also specify dojo as a dependency for the "qpid-broker" module 
in the "File -> Project Structure..." menu.

Hope that helps.

Kind regards,
Lorenz


On 09/03/16 12:18, Indika Sampath wrote:
> Hi All,
>
> I forked qpid [1] and studying the implementation. I was create Jmeter
> scripts to publish and subscribe. Those are working fine. So I started to
> identify message publishing flow. I am using Intellij Idea community
> edition version 15. Project imported to Intellij Idea correctly. Next I set
> debug config which is transport to socket and port to 8000. Then start
> broker with ./qpid-server -run:jpda.
>
> I added break point to line inside deliverCurrentMessageIfComplete() method
> in AMQChannel. But when I hit the broker by publisher, debug point not
> getting executed. Could you please point out correct way of debug code and
> identify message publishing flow.
>
> [1] https://github.com/apache/qpid-java
>
> Cheers!
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Re: [Help] Debug qpid code

Posted by Rob Godfrey <ro...@gmail.com>.
Which version of the AMQP protocol are you using to publish your messages?

AMQChannel is only used for the 0-8, 0-9, and 0-9-1 protocols.
If you are using AMQP 0-10 or AMQP 1.0 your breakpoint will never be hit.

Cheers,
Rob

On 9 March 2016 at 12:18, Indika Sampath <in...@gmail.com>
wrote:

> Hi All,
>
> I forked qpid [1] and studying the implementation. I was create Jmeter
> scripts to publish and subscribe. Those are working fine. So I started to
> identify message publishing flow. I am using Intellij Idea community
> edition version 15. Project imported to Intellij Idea correctly. Next I set
> debug config which is transport to socket and port to 8000. Then start
> broker with ./qpid-server -run:jpda.
>
> I added break point to line inside deliverCurrentMessageIfComplete() method
> in AMQChannel. But when I hit the broker by publisher, debug point not
> getting executed. Could you please point out correct way of debug code and
> identify message publishing flow.
>
> [1] https://github.com/apache/qpid-java
>
> Cheers!
>