incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajeshwar Mitra <Rajeshwar.Mi...@symphonysv.com>
Subject RE: How to fire events back to client-adpater
Date Mon, 07 May 2012 08:39:18 GMT
Hi ,
I'm using the same driver and it is listening to the same port(2334- the default one). The
same client application is looking for all the streams in which it is interested. The command
I'm running as follows,

java MyClientApp Server port stream1, stream2 ,stream3.

It depends on how do you code your client. I'm using a main application where third  argument
I'm parsing to get the stream names. Then registering the stream names with the driver. That's
it.
Now, you receive Messages through driver in a continuous loop.

I hope it helps.

Thanks
Rajeshwar

From: Banawalikar, Omkar IN BLR SISL [mailto:omkar.banawalikar.ext@siemens.com]
Sent: Monday, May 07, 2012 1:55 PM
To: s4-user@incubator.apache.org
Subject: RE: How to fire events back to client-adpater

Hi,
Are you using the same driver object to get multiple streams? Is /Are the driver object/s
listening to same port? Are those streams in the same java process?

Omkar Banawalikar

From: Rajeshwar Mitra [mailto:Rajeshwar.Mitra@symphonysv.com]
Sent: Monday, May 07, 2012 10:49 AM
To: s4-user@incubator.apache.org
Subject: RE: How to fire events back to client-adpater

Yes, I'm able to get multiple streams from s4 clusters.

Thanks
Rajeshwar

From: Banawalikar, Omkar IN BLR SISL [mailto:omkar.banawalikar.ext@siemens.com]
Sent: Monday, May 07, 2012 9:42 AM
To: s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>
Subject: RE: How to fire events back to client-adpater

Rajesh, are you able to get back multiple streams from the S4 cluster so that it can be read
by different processes.

http://mail-archives.apache.org/mod_mbox/incubator-s4-user/201204.mbox/%3c7E6556E29FAE084590BE56A0BB7AA5CC600C194EA5@INBLRK77M2MSX.in002.siemens.net%3e


From: Rajeshwar Mitra [mailto:Rajeshwar.Mitra@symphonysv.com]
Sent: Friday, May 04, 2012 11:08 AM
To: s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>
Subject: RE: How to fire events back to client-adpater

Thank you for the reply. However, I resolved the issue by correcting the configuration. Yes
it is possible to inject any S4 classes like dispatcher to any non-S4 java beans. It is not
necessary that dispatchEvent has to be called on dispatcher from processEvent method.

Thanks
Rajeshwar


From: Banawalikar, Omkar IN BLR SISL [mailto:omkar.banawalikar.ext@siemens.com]
Sent: Thursday, May 03, 2012 7:41 PM
To: s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>
Subject: RE: How to fire events back to client-adpater

I guess the dispatcher.dispatchEvent() method should be called from processEvent() method.
You have not included the processEvent() method.


Omkar Banawalikar

From: Rajeshwar Mitra [mailto:Rajeshwar.Mitra@symphonysv.com]
Sent: Friday, April 27, 2012 6:12 PM
To: s4-user@incubator.apache.org<mailto:s4-user@incubator.apache.org>
Subject: How to fire events back to client-adpater

Hi All,

I'm trying to dispatch custom events back to client-adapter where the client- application
will listen to.

My class is as follows,

public class CartListener implements UpdateListener{// Esper CEP Listener

                private StreamSelectingDispatcher dispatcher;



                public StreamSelectingDispatcher getDispatcher() {
                                return dispatcher;
                }



                public void setDispatcher(StreamSelectingDispatcher dispatcher) {
                                this.dispatcher = dispatcher;
                }



                @Override
                public void update(EventBean[] newEvents, EventBean[] oldEvents) {
        EventBean event = newEvents[0];
        String itemList =(String)event.get("cartItemList");
        System.out.println("Cart Item List is " + itemList);
        Logger.getLogger("cart").info("Found matching Cart with items : " + itemList);
                                Recommendation recomend = new Recommendation();
                                recomend.setFlag("Found matching Cart with items : " + itemList);

        dispatcher.dispatchEvent("Recommendation", recomend);// Null pointer Exception occurring
from here.
                }

The spring configuration to set the beans as follows.

<bean id="cartListener" class="com.gsshop.example.listener.CartListener">
                <property name="dispatcher" ref="selectiveDispatchToAdapter"/>
   </bean>
<bean id="selectiveDispatchToAdapter" class="io.s4.dispatcher.StreamSelectingDispatcher">
          <property name="dispatcher" ref="dispatcherToClientAdapters"/>
          <property name="streams">
            <list>
              <value>Recommendation</value>
            </list>
          </property>
  </bean>

When I deploy and run S4 there is no error in initializing the beans. At runtime, the Nullpointer
Exception happens. Dispatcher remains null.

Any help will be useful.

Thanking you,
Rajeshwar Mitra

________________________________
NOTICE TO RECIPIENT: THIS E-MAIL (INCLUDING ANY ATTACHMENTS) IS MEANT FOR ONLY THE INTENDED
RECIPIENT OF THE TRANSMISSION, MAY CONTAIN CONFIDENTIAL INFORMATION, AND IS PROTECTED BY LAW.
IF YOU RECEIVED THIS E-MAIL IN ERROR, PLEASE IMMEDIATELY NOTIFY THE SENDER OF THE ERROR BY
RETURN E-MAIL, DELETE THIS COMMUNICATION AND SHRED ANY ATTACHMENTS. UNAUTHORIZED REVIEW, USE,
DISSEMINATION, DISTRIBUTION, COPYING OR TAKING OF ANY ACTION BASED ON THIS COMMUNICATION IS
STRICTLY PROHIBITED.

Mime
View raw message