What you configured here is a service that uses jms transport and a topic. That looks good at least for the server side. So if your start your server then it will register a a subscriber to the topic.

I guess you have a similar configuration for the client?

So if you started your service and then called it from a client that lives in another process it was successful. You can check that it really is pub/sub by starting a second serice witth the same config. If both services get called then it really works.

You should also be aware that a pub / sub service normally has to be one way.

A request / reply service also works for one consumer but not for more than one. The reason is that the client will create a temp reply queue and the service will reply to it. The client will only wait for one reply though so in case you have no service listening the client would time out. If you have more than one service listening then all replies beside the first will be discarded.

Christian


Am 02.05.2011 14:06, schrieb [email protected]:
Look.

I am having a web service project which uses JMS Queue i.e. PTP pattern.
Now I generated the client for the above service and able to invoke it.

Now I wish to implement PUB/SUB pattern.
So I configured Topic in JMS server and just modify my project configuration
as per below

  <jms:destination
name="{http://www.springframework.org/schema/beans}HelloPort.jms-destination";>
                <jms:address  destinationStyle="topic"
                                  
jndiConnectionFactoryName="jms/ConnectionFactory"
                                  jndiDestinationName="jms/Topic">
        <jms:JMSNamingProperty name="java.naming.factory.initial"
value="weblogic.jndi.WLInitialContextFactory"/>
        <jms:JMSNamingProperty name="java.naming.provider.url"
value="t3://localhost:7001"/>
                </jms:address>
        </jms:destination>


and to invoke the web service I did the modification in my JNDI endpoint URI
to
JMS_ENDPOINT_URI =

"jms:jndi:jms/Topic?jndiInitialContextFactory=weblogic.jndi.WLInitialContextFactory&"
+

"jndiConnectionFactoryName=jms/ConnectionFactory&jndiURL=t3://localhost:7001";

Now I invoked web service.
It get worked. does it mean it worked. BUT I haven't configured the
subscriber for this end point.



FYI..

My configuration file contains only below part other than import statements
and namespaces.

<jaxws:endpoint
                id="HelloService"
                address="jms://"
                endpointName="HelloPort"
                implementor="com.example.jmsservice.impl.HelloServiceImpl"
                transportId="http://cxf.apache.org/transports/jms";>             
   
        </jaxws:endpoint>
                
        <jms:destination
name="{http://www.springframework.org/schema/beans}HelloPort.jms-destination";>
                <jms:address  destinationStyle="topic"
                                  
jndiConnectionFactoryName="jms/ConnectionFactory"
                                  jndiDestinationName="jms/Topic">
        <jms:JMSNamingProperty name="java.naming.factory.initial"
value="weblogic.jndi.WLInitialContextFactory"/>
        <jms:JMSNamingProperty name="java.naming.provider.url"
value="t3://localhost:7001"/>
                </jms:address>
        </jms:destination>







--
View this message in context: 
http://cxf.547215.n5.nabble.com/How-to-implement-PUB-SUB-model-in-Web-service-tp4364484p4364535.html
Sent from the cxf-dev mailing list archive at Nabble.com.


--
Christian Schneider
CXF and Camel Architect
SOPERA - The Application Integration Division of Talend
http://www.talend.com

Reply via email to