activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <a...@crackpot.org>
Subject Re: getting started with activemq development
Date Thu, 23 Sep 2010 22:57:56 GMT
I'm working on some tests for MessageListenerServlet.

The first stumbling block I've hit is that I can't seem to access the headers returned by
the broker after I send a POST to listen on a queue.  I believe I need to get the JSESSIONID
cookie value, so I can send it in subsequent GET requests to pick up messages on the queue
I've subscribed to.

The test: http://pastie.org/1177995
Test output: http://pastie.org/1178030
Sorry for the ugly output, pastie doesn't seem to allow control of line breaks on long lines.

This code shows 2 separate ways I've tried accessing the response headers.
 1. Implementing ContentExchange.onResponseHeader.  My callback is never called, though my
other onRequestComplete and onResponseComplete callbacks are.
 2. Trying to use ContentExchange.getResponseFields().  The returned object is null.

I'm using contentExchange.waitForDone(), so I think this code should be synchronous.  All
headers should be available at the point in my code when I try to read them.  But that isn't
the case at the moment.  Just to be sure, I've put in Thread.sleep() calls up to 10000ms before
trying to read headers, but the result is the same.

I watched port 8080 in wireshark while my test was running, and I did see that the 'Set-Cookie'
header was returned by the server. 
http://skitch.com/alexdean/d2g2b/capturing-from-lo0-wireshark

alex

On Sep 23, 2010, at 6:04 AM, Dejan Bosanac wrote:

> Hi Alex,
> 
> web part of the ActiveMQ is least tested. I started some effort in
> that area and you can now find RestTest in activemq-web-demo module.
> That module should contain all tests, as it is easy to start web
> server in the test and have the whole demo-app environment ready for
> testing.
> 
> The idea is to have there tests for Ajax and WebSocket stuff. It'd be
> great to use something like WebDriver to run your js tests and verify
> that everything passes. Every contribution from your side is more than
> welcome.
> 
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> 
> On Wed, Sep 22, 2010 at 7:38 PM, Alex Dean <alex@crackpot.org> wrote:
>> I have been able to run tests for activemq-core via maven.  Thanks.  I'm looking
for tests in activemq-web, and not finding any.  Are there no tests for AjaxServlet, MessageListenerServlet,
etc?  I suspect maybe I'm looking in the wrong place.
>> 
>> alex
>> 
>> On Sep 22, 2010, at 11:44 AM, Dejan Bosanac wrote:
>> 
>>> Hi Alex,
>>> 
>>> the best thing for starters is to check some unit tests and get
>>> familiar with them. We're doing all the development based on those,
>>> there you can easily start/stop broker(s), send/consume messages.
>>> 
>>> You can run them both from Eclipse (IDE) and using maven, like
>>> 
>>> $ cd activemq-core
>>> $ mvn -Dtest=JMSConsumerTest test
>>> 
>>> You can also rely on logging (see src/test/resources/log4j.properties)
>>> to adjust it to your needs and put some additional traces where you
>>> need them.
>>> 
>>> For debugging, also, just run the test using Eclipse (or any other
>>> debugging tool you need). There are also options for debugging
>>> standalone brokers if you wish.
>>> 
>>> As for the eclipse, you can always only use the submodule you're
>>> interested in, like activemq-core
>>> 
>>> You can also check IntelliJ IDEA.
>>> 
>>> 
>>> Cheers
>>> --
>>> Dejan Bosanac - http://twitter.com/dejanb
>>> 
>>> Open Source Integration - http://fusesource.com/
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Blog - http://www.nighttale.net
>>> 
>>> 
>>> 
>>> On Wed, Sep 22, 2010 at 6:07 PM, Alex Dean <alex@crackpot.org> wrote:
>>>> I've not done much Java development, and definitely not on a codebase of
the size of ActiveMQ.  I'm finding it a little difficult to get started, and I could use some
help.  I wrote previously about some problems I've had getting Eclipse set up, but even once
I've sorted that out I'm not sure where to go next.
>>>> 
>>>> I want to be able to :
>>>>  * compile any changes i've made in the code
>>>>  * set some breakpoints in the code
>>>>  * start the server
>>>>  * make a request from a client
>>>>  * watch what's happening at the breakpoints I've set
>>>> 
>>>> I'd also like to know how to run the activemq unit tests, both as a full
suite and individually.
>>>> 
>>>> It doesn't matter to me whether all of this is done in Eclipse, or via a
combination of IDE & command-line programs.  I don't care about sticking with Eclipse.
 If anyone can point me at a different (though still free) IDE/editor, I have no objection
to switching.
>>>> 
>>>> Can someone point me at a tutorial on how to do some/all of this?  I've been
googling for 'activemq eclipse' 'activemq development' and similar phrases, and not finding
anything.
>>>> 
>>>> A 'getting started' guide, that that provided by the Geoserver project (http://geoserver.org/display/GEOSDOC/3+Eclipse+Quickstart)
would be wonderful.  I'd be willing to write one, get screenshots, etc, if only I knew what
to put in it. :)
>>>> 
>>>> Help?
>>>> 
>>>> thanks,
>>>> alex
>>> 
>> 
>> 
> 


Mime
View raw message