Hi Dan, I think it will be useful when I describe in more details what I want to achieve:
I have some producer's, say p1, p2 and p3. Those producer's will be Jms Topic's with on each Topic a durable subscription. On the other hand I have client's, let's say c1, c2 and c3. What I want now is that c1 only retrieves messages via getCurrentMessage from p3, c2 will subscribe to p1 and c3 subscribes to p2. Neither of them may receive messages from another producer. So I have to set the topic for getCurrentMessage and filter's for subscribing from p1 and p2. What I want to do is to have a factory that creates p1, p2 and p3. Then I need the names of the topic's to which c1, c2 and c3 must be attached. The problem is, that the client's are not allowed to retrieve the names of the topic's. I give the client's the topic names and they can only attach to the topic name I gave them. I already started this morning a factory.wsdl and succeeded that my FactoryCapabiliyImpl class is called. Now I wanted to get on by using the example from http://www-128.ibm.com/developerworks/autonomic/library/ac-muse.html Keep your WSDM endpoints trim with Apache Muse Written by Dan Jemiolo ;-) When those Jms Topic resources are created, I need a way to know how to address them, so that I can give the names to the client's. Later on I will then see if it is useful to make the creation of Jms Topic's manageable by WSRF. Prior to this I have to see that I get WS-Security activated and WS-Reliable Message running, as I may not loose any message :-( So my actual priority is to get some messages through Muse. Best regards, Matthias -----Ursprüngliche Nachricht----- Von: Daniel Jemiolo [mailto:[EMAIL PROTECTED] Gesendet: Montag, 19. März 2007 14:01 An: [email protected] Betreff: Re: AW: Relation between Resource and Topic 1. I'm not sure why the property names would be relevant to your subscribe()/getCurrentMessage() calls - the name of the topic property is always {http://docs.oasis-open.org/wsn/b-2}TopicExpression. Calling getResourceProperty() from a client will return you the topics that have been registered with the resource: // // old-fashioned way - raw XML // Element topicXML = client.getResourceProperty(WsnConstants.TOPIC_EXPRESSION_QNAME); // // new and exciting way - get QNames back // QName[] topics = client.getPropertyAsObject(WsnConstants.TOPIC_EXPRESSION_QNAME, QName.class); Of course, if you use wsdl2java to generate a client for your WSDL (with the -proxy flag), it will make a more convenient getTopicExpression() method for you. There is no rule, though, that the topics must all fit under one namespace, or be tied to one resource type - their QNames shouldn't be related to the property constants created by wsdl2java. 2. The RMD stuff (resource metadata) is from WSRF, not WSDM - it doesn't require any of the manageability stuff. It just provides permissions and validation for WSRF resource properties. You can access the values in the metadata programmatically after declaring them in the RMD file. This is what the WSN implementation does in order to take your TopicExpression values and make working topics out of them. Dan "Beil, Matthias" <[EMAIL PROTECTED]> wrote on 03/19/2007 04:33:14 AM: > Hi Dan, > > Thanks for your reply. Here are my remarks: > > 1). I succeeded in creating a resource and have calls to "Subscribe" and > "GetCurrentMessage" working. What was missing for me, and I could deduce it > finally by reading some other thread on the mailing list, was how to address a > specific topic. What I found out was the following: > > When there is a resource r with the PREFIX and NAMESPACE_URI then the QName > for the topic must be > > QName qname = new QName(r.NAMESPACE_URI, r.PROPERTIES.getLocalPart(), r.PREFIX); > > Where PROPERTIES is > > private static final QName[] PROPERTIES = new QName[] { > new QName(NAMESPACE_URI, "ResourceName", PREFIX) > }; > > from the Implementation of the resource. With this QName it was then possible > to setup the filter for the "Subscribe" method > > Filter filter = new TopicFilter(qname); > > and the > > final NotificationMessage msg = producer.getCurrentMessage(qname); > > With this it was possible to get both methods working by selecting a specific > topic (of course the getCurrentMessage didn't return a message, but a > NoCurrentMessageOnTopicFault, but that was expected ;-) > > Maybe this is trivial, but for me it was not clear how to access a topic and > so reference a resource. > > For the properties you mentioned the spec. > > http://docs.oasis-open.org/wsn/wsn-ws_base_notification-1.3-spec-os.pdf > > defines them in chapter 4.1 (Lines from 401 up to 466). Also I found some > examples and some mailing thread where this was already said. So this was > solved rather quickly. > > 2. and 3. > > I was thinking of using a factory resource and to create my own Jms Topic > resources by means of some external resource property file. As I'm focusing on > WS-N, I didn't investigate any time in the WSDM spec. So I will have a look at > those and see for the RMD file. > > 4. I don't agree on using the subscription.destroy method. But I would like to > discuss this in another thread as IMHO this does not belong in this thread ;-) > > I will see after the RMD file and see what is for me the best way of creating > the resources. > > When I found a solution I will report this in this thread. > > THX again a lot. > > Matthias > > > -----Ursprüngliche Nachricht----- > Von: Daniel Jemiolo [mailto:[EMAIL PROTECTED] > Gesendet: Samstag, 17. März 2007 18:09 > An: [email protected] > Betreff: Re: Relation between Resource and Topic > > Hi, > > Each resource that includes the WSN NotificationProducer capability as > part of its definition can have topics. These topics allow other resources > to subscribe to a subset of notifications from the producer resource (the > subscriber can also subscribe on behalf of other resources, in effect > saying "please send notifications on topic X to resource Y (not me)"). The > way to implement your scenario would be as follows: > > 1. Add the WSN NotificationProducer properties and operations to your > WSDL. The tutorial's sample WSDL and the wsn-producer sample project WSDL > both have all of the XML you need - just cut and paste. The properties are > TopicExpression, TopicExpressionDialect, TopicSet, and FixedTopicSet; the > operations are Subscribe and GetCurrentMessage. > > 2. Create an RMD (metadata) file and add a <Property/> entry for the > TopicExpression property. The wsrf and wsn-producer sample projects both > have example RMD files, and the WSDL portType link to those RMD files. The > <Property/> metadata for TopicExpression should look like this: > > <Property xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" > name="wsnt:TopicExpression" modifiability="read-only" > mutability="constant"> > <StaticValues> > <wsnt:TopicExpression > xmlns:myns="http://my/topic/namespace">myns:MyTopicName<wsnt:TopicExpression> > > ... more > > </StaticValues> > </Property> > > > You can fill in as many instances of TopicExpression as you like, and they > will be loaded when the application is started. That way, when clients > query your resource to see what topics it has (using > GetResourceProperty(wsnt:TopicExpression)), they'll get the list of topics > you put in the RMD file. They can then use those topic names in the > subscribe() requests. > > In your case, you can create one <TopicExpression/> for each JMS topic you > want to expose. > > > 3. Run WSDL2Java. It will generate the code/XML for your resource > definition, and add the WSN subscription resource as well. By default, one > instance of your producer resource will be created at application startup, > and new subscription resources will be created for each call to > subscribe(). > > 4. From the client side, you can use > org.apache.muse.ws.notification.remote.NotificationProducerClient to > invoke subscribe() and getCurrentMessage(). The subscribe() method will > return a SubscriptionClient, the primary use of which is to invoke > destroy() when you want the notifications to stop (if ever). > > > Let me know if you need me to elaborate on any of these steps. > > Dan > > > "Beil, Matthias" <[EMAIL PROTECTED]> wrote on 03/15/2007 11:43:11 AM: > > > Hi, > > > > > > > > I just started with Muse and can not find a solution for my problem. > > > > > > > > My scenario is a follow: > > > > > > > > - I have several Jms Topic to manage. For each Jms Topic I want to > > define a Ws-Topic where clients can subscribe to. For each subscription > > a durable subscription will be created on the Jms Topic (parameter > > involved are clientID and messageSelector). > > > > > > > > With the subscription created the client can either retrieve messages > > via the GetCurrentMessage method, or register for receiving "notify" > > messages. > > > > > > > > My question is now, how do I setup this? What kind of resource do I have > > to setup? How is a resource related to a Ws-Topic and how do I address > > such a Ws-Topic. Where can I find some documentation/source code or > > useful information's about of those details? > > > > > > > > I have read the WS-N, WS-WSRF spec's, gone through the Muse > > documentation, checked the samples, had a look over the mail archive, > > but couldn't make up how resources and topic's are related which each > > other. Also the addressing isn't clear for me. > > > > > > > > Any help would be appreciated. THX > > > > > > > > Mit freundlichen Gruessen / With kind regards > > > > Matthias Beil > > > > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
