You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrea Gazzarini <a....@gmail.com> on 2009/02/11 15:34:36 UTC

Implementation of WS-Notifications (QPID-1582)

Hi all,
the last step (at the moment) of QMan is here : I just submitted code for
QPID-1582 (implementation on QMan of WS-Notification).

As first version there are only two topics : one for lifecycle events of
object instances (create & remove) and one for lifecycle events (only
create) of events.
That means:

1) There are two topics : qman:ObjectsLifeCycleTopic and
qman:EventsLifeCycleTopic
2) QMan will publish on the first one the following message when (for
example) a connection is created :

<wsnt:NotificationMessage
    xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
    xmlns:qman="http://amqp.apache.org/qpid/management/qman"
    xmlns:qman-wsa="http://amqp.apache.org/qpid/management/qman/addressing"
    xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsnt="
http://docs.oasis-open.org/wsn/b-2">
    <wsnt:SubscriptionReference>
        <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://romagazzarini:8080/qman/services/SubscriptionManager</wsa:Address>
        <wsa:ReferenceParameters xmlns:wsa="
http://www.w3.org/2005/08/addressing">
            <qman-wsa:ResourceId xmlns:qman-wsa="
http://amqp.apache.org/qpid/management/qman/addressing
">09c45414-1adf-4bf1-b855-71c9597176e0</qman-wsa:ResourceId>
        </wsa:ReferenceParameters>
    </wsnt:SubscriptionReference>
    <wsnt:Topic
        Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete"
xmlns:qman="http://amqp.apache.org/qpid/management/qman
">qman:EventsLifeCycleTopic</wsnt:Topic>
    <wsnt:ProducerReference>
        <wsa:ReferenceParameters xmlns:wsa="
http://www.w3.org/2005/08/addressing"/>
        <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://romagazzarini:8080/qman/services/adapter</wsa:Address>
    </wsnt:ProducerReference>
    <wsnt:Message>
        <qman:LifeCycleEvent TimeMillis="1234295015000" Type="CREATED"
xmlns:qman="http://amqp.apache.org/qpid/management/qman">
            <qman:Resource>
                <qman-wsa:ResourceId xmlns:qman-wsa="
http://amqp.apache.org/qpid/management/qman/addressing
">aff2f6ec-2e5c-4768-ae87-6da2c8a005ff</qman-wsa:ResourceId>
                <qman:PackageName>org.apache.qpid.broker</qman:PackageName>
                <qman:Name>connection</qman:Name>
            </qman:Resource>
        </qman:LifeCycleEvent>
    </wsnt:Message>
</wsnt:NotificationMessage>

3) A similar notification (but with type="REMOVED") will be published when
an object instance (a connection for example) is removed

4) For events there are only CREATE notification. So on the second mentioned
topic a message will be published each time an "event" (for example a
subscribe event) is created on QMan (and therefore on Qpid)

Management clients will be able to subscribe to a topic and eventually can
specify a filter and the duration of the subscription.
This is a sample subscribe request :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://romagazzarini:8080/qman/services/adapter</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing
">uuid:d0e13e13-63ee-5302-7b41-a1109776d168</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
            <wsnt:ConsumerReference>
                <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing
">http://romagazzarini:8080/qman/services/consumer</wsa:Address>
            </wsnt:ConsumerReference>
            <wsnt:Filter>
                <wsnt:TopicExpression
                    Dialect="
http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xmlns:qman="
http://amqp.apache.org/qpid/management/qman">qman:ObjectsLifeCycleTopic</wsnt:TopicExpression>
*<-- The client is interested on qman:ObjectsLifeCycleTopic*. *If this
filter is omitted client will receive all messages of all topics*
            </wsnt:Filter>

<wsnt:TerminationTime>2009-02-10T20:56:09+01:00</wsnt:TerminationTime>* <--
Subscription will end on this date*. *If this is omitted the subscription
won't never end.*
        </wsnt:Subscribe>
    </soap:Body>
</soap:Envelope>


Further improvement will be made in order to meet (eventual) management
client needs.

I believe now It's time to write documentation... :) Let's start!

Best regards,
Andrea

Re: Implementation of WS-Notifications (QPID-1582)

Posted by Aidan Skinner <ai...@apache.org>.
On Wed, Feb 11, 2009 at 4:00 PM, Andrea Gazzarini <a....@gmail.com> wrote:

> Sorry the tests were failing because I forgot to change a little thing
> on a class.
> I immediately made another submit for that.
> That's the reason why now should be ok

Ah, awesome. Thanks dude.

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Implementation of WS-Notifications (QPID-1582)

Posted by Andrea Gazzarini <a....@gmail.com>.
Sorry the tests were failing because I forgot to change a little thing
on a class.
I immediately made another submit for that.
That's the reason why now should be ok

Regards
Andrea

On 2/11/09, Aidan Skinner <ai...@apache.org> wrote:
> On Wed, Feb 11, 2009 at 3:40 PM, Robbie Gemmell <ge...@dcs.gla.ac.uk>
> wrote:
>
>> Oddness, works here:
>>
>>    [junit] Running org.apache.qpid.management.wsdm.WsDmAdapterTest
>>    [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 8.445 sec
>
> It just passed for me, although it had been failing consistently
> before that.  Weird..
>
> - Aidan
> --
> Apache Qpid - World Domination through Advanced Message Queueing
> http://qpid.apache.org
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Implementation of WS-Notifications (QPID-1582)

Posted by Aidan Skinner <ai...@apache.org>.
On Wed, Feb 11, 2009 at 3:40 PM, Robbie Gemmell <ge...@dcs.gla.ac.uk> wrote:

> Oddness, works here:
>
>    [junit] Running org.apache.qpid.management.wsdm.WsDmAdapterTest
>    [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 8.445 sec

It just passed for me, although it had been failing consistently
before that.  Weird..

- Aidan
-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


RE: Implementation of WS-Notifications (QPID-1582)

Posted by Robbie Gemmell <ge...@dcs.gla.ac.uk>.
Oddness, works here:

    [junit] Running org.apache.qpid.management.wsdm.WsDmAdapterTest
    [junit] Tests run: 12, Failures: 0, Errors: 0, Time elapsed: 8.445 sec


-----Original Message-----
From: aidan.skinner@gmail.com [mailto:aidan.skinner@gmail.com] On Behalf Of
Aidan Skinner
Sent: 11 February 2009 15:16
To: dev@qpid.apache.org
Subject: Re: Implementation of WS-Notifications (QPID-1582)[MESSAGE NOT
SCANNED]

On Wed, Feb 11, 2009 at 2:34 PM, Andrea Gazzarini <a....@gmail.com>
wrote:

> the last step (at the moment) of QMan is here : I just submitted code for
> QPID-1582 (implementation on QMan of WS-Notification).

I just updated and 12 tests in WsDmAdapterTest now fail for me with
the following stack:


java.lang.NullPointerException
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:872)
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:815)
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:791)
at
org.apache.muse.ws.addressing.soap.SimpleSoapClient.send(SimpleSoapClient.ja
va:312)
at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:285)
at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.ja
va:254)
at
org.apache.muse.ws.resource.remote.WsResourceClient.getResourceProperty(WsRe
sourceClient.java:138)
at
org.apache.muse.ws.resource.sg.remote.ServiceGroupClient.getMembers(ServiceG
roupClient.java:110)
at
org.apache.qpid.management.wsdm.WsDmAdapterTest.setUp(WsDmAdapterTest.java:1
60)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)

:(

- Aidan

-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Implementation of WS-Notifications (QPID-1582)

Posted by Aidan Skinner <ai...@apache.org>.
On Wed, Feb 11, 2009 at 2:34 PM, Andrea Gazzarini <a....@gmail.com> wrote:

> the last step (at the moment) of QMan is here : I just submitted code for
> QPID-1582 (implementation on QMan of WS-Notification).

I just updated and 12 tests in WsDmAdapterTest now fail for me with
the following stack:


java.lang.NullPointerException
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:872)
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:815)
at org.apache.muse.util.xml.XmlUtils.getAllElements(XmlUtils.java:791)
at org.apache.muse.ws.addressing.soap.SimpleSoapClient.send(SimpleSoapClient.java:312)
at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:285)
at org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:254)
at org.apache.muse.ws.resource.remote.WsResourceClient.getResourceProperty(WsResourceClient.java:138)
at org.apache.muse.ws.resource.sg.remote.ServiceGroupClient.getMembers(ServiceGroupClient.java:110)
at org.apache.qpid.management.wsdm.WsDmAdapterTest.setUp(WsDmAdapterTest.java:160)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)

:(

- Aidan

-- 
Apache Qpid - World Domination through Advanced Message Queueing
http://qpid.apache.org

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Implementation of WS-Notifications (QPID-1582)

Posted by Andrea Gazzarini <a....@gmail.com>.
If you're interested on QMan development progress here it is :
https://issues.apache.org/jira/browse/QPID-1574

As usual any comment would be appreciated.

Regards,
Andrea

2009/2/11 Andrea Gazzarini <a....@gmail.com>

> Hi all,
> the last step (at the moment) of QMan is here : I just submitted code for
> QPID-1582 (implementation on QMan of WS-Notification).
>
> As first version there are only two topics : one for lifecycle events of
> object instances (create & remove) and one for lifecycle events (only
> create) of events.
> That means:
>
> 1) There are two topics : qman:ObjectsLifeCycleTopic and
> qman:EventsLifeCycleTopic
> 2) QMan will publish on the first one the following message when (for
> example) a connection is created :
>
> <wsnt:NotificationMessage
>     xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
>     xmlns:qman="http://amqp.apache.org/qpid/management/qman"
>     xmlns:qman-wsa="http://amqp.apache.org/qpid/management/qman/addressing
> "
>     xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsnt="
> http://docs.oasis-open.org/wsn/b-2">
>     <wsnt:SubscriptionReference>
>         <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://romagazzarini:8080/qman/services/SubscriptionManager</wsa:Address>
>         <wsa:ReferenceParameters xmlns:wsa="
> http://www.w3.org/2005/08/addressing">
>             <qman-wsa:ResourceId xmlns:qman-wsa="
> http://amqp.apache.org/qpid/management/qman/addressing
> ">09c45414-1adf-4bf1-b855-71c9597176e0</qman-wsa:ResourceId>
>         </wsa:ReferenceParameters>
>     </wsnt:SubscriptionReference>
>     <wsnt:Topic
>         Dialect="
> http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xmlns:qman="
> http://amqp.apache.org/qpid/management/qman
> ">qman:EventsLifeCycleTopic</wsnt:Topic>
>     <wsnt:ProducerReference>
>         <wsa:ReferenceParameters xmlns:wsa="
> http://www.w3.org/2005/08/addressing"/>
>         <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://romagazzarini:8080/qman/services/adapter</wsa:Address>
>     </wsnt:ProducerReference>
>     <wsnt:Message>
>         <qman:LifeCycleEvent TimeMillis="1234295015000" Type="CREATED"
> xmlns:qman="http://amqp.apache.org/qpid/management/qman">
>             <qman:Resource>
>                 <qman-wsa:ResourceId xmlns:qman-wsa="
> http://amqp.apache.org/qpid/management/qman/addressing
> ">aff2f6ec-2e5c-4768-ae87-6da2c8a005ff</qman-wsa:ResourceId>
>                 <qman:PackageName>org.apache.qpid.broker</qman:PackageName>
>                 <qman:Name>connection</qman:Name>
>             </qman:Resource>
>         </qman:LifeCycleEvent>
>     </wsnt:Message>
> </wsnt:NotificationMessage>
>
> 3) A similar notification (but with type="REMOVED") will be published when
> an object instance (a connection for example) is removed
>
> 4) For events there are only CREATE notification. So on the second
> mentioned topic a message will be published each time an "event" (for
> example a subscribe event) is created on QMan (and therefore on Qpid)
>
> Management clients will be able to subscribe to a topic and eventually can
> specify a filter and the duration of the subscription.
> This is a sample subscribe request :
>
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
>     <soap:Header>
>         <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://romagazzarini:8080/qman/services/adapter</wsa:To>
>         <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
> http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
> </wsa:Action>
>         <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing
> ">uuid:d0e13e13-63ee-5302-7b41-a1109776d168</wsa:MessageID>
>         <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
>             <wsa:Address>
> http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
>         </wsa:From>
>     </soap:Header>
>     <soap:Body>
>         <wsnt:Subscribe xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
>             <wsnt:ConsumerReference>
>                 <wsa:Address xmlns:wsa="
> http://www.w3.org/2005/08/addressing">
> http://romagazzarini:8080/qman/services/consumer</wsa:Address>
>             </wsnt:ConsumerReference>
>             <wsnt:Filter>
>                 <wsnt:TopicExpression
>                     Dialect="
> http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xmlns:qman="
> http://amqp.apache.org/qpid/management/qman">qman:ObjectsLifeCycleTopic</wsnt:TopicExpression>
> *<-- The client is interested on qman:ObjectsLifeCycleTopic*. *If this
> filter is omitted client will receive all messages of all topics*
>             </wsnt:Filter>
>
> <wsnt:TerminationTime>2009-02-10T20:56:09+01:00</wsnt:TerminationTime>*<-- Subscription will end on this date
> *. *If this is omitted the subscription won't never end.*
>         </wsnt:Subscribe>
>     </soap:Body>
> </soap:Envelope>
>
>
> Further improvement will be made in order to meet (eventual) management
> client needs.
>
> I believe now It's time to write documentation... :) Let's start!
>
> Best regards,
> Andrea
>