Thanks... I misread the doc on Filter and was assuming that this filtering would take place on the client. But it is indeed used on the server to determine which messages to sent out to the subscriber. The topic information is now included in the subscribe requests.

Regards,
Gero


[EMAIL PROTECTED] wrote:
Hi Gero

It's all handled with the call to producerClient.subscribe(consumer, null, null);
http://ws.apache.org/muse/docs/2.2.0/javadoc/org/apache/muse/ws/notifica
tion/impl/SimpleNotificationProducer.html

Where parameter 2 is for your filter (topic), see
http://ws.apache.org/muse/docs/2.2.0/javadoc/org/apache/muse/ws/notifica
tion/impl/TopicFilter.html
And the parameter 3 is for your policies.

At least that's my understanding, I'm sure Dan has a better
clarification. Based on my understanding I would say you need to put the
topic of choice in the 2 parameter position in your .subscribe call

/Lenni


-----Original Message-----
From: Gero Vermaas [mailto:[EMAIL PROTECTED] Sent: 21 March 2007 11:40
To: [email protected]
Subject: How to subscribe to topic

Hi,

This may be a very basic question, but I have not been able to find a answer myself yet...

I've got the following code:
    Topic topic = ...
URI producerEndpointURI = new URI(producerEndpointURL);
    EndpointReference epr = new EndpointReference(producerEndpointURI);
String webAppRoot = "/ossj-tck-wsn-consumer/services";
    String contextPath = webAppRoot + "/consumer";
    URI address = getLocalAddress(contextPath, consumerPort);
    EndpointReference consumer = new EndpointReference(address);
// null filter == send all messages to consumer
    producerClient = new NotificationProducerClient(epr);
    producerClient.setTrace(true);
wsnPropagator.subscribe(wsnTopicQName, this); producerClient.subscribe(consumer, null, null);

The question I now have it how do I till the producer that the client wants to subscribe to a specific Topic.

As a background, I'm building the client side and the guys building the server side that sends out the notification expect something like

<wsnt:TopicExpression Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple";> System/JSR264/ApplicationType/OrderManagement/Application/0-11;0-0;Refer
enceImplementation/Comp/XVTEventTopic
</wsnt:TopicExpression>

as part of the subscribe request. I can't find a way to tell the producer the topicexpression.

Is there an example that illustrates this?

Regards,
Gero

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to