You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SenthilKumar K <se...@gmail.com> on 2017/07/26 09:44:52 UTC
Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Hello Camel Users , Recently i started exploring possibilities of
streaming data from Cassandra Table for my use case, found
*https://github.com/apache/camel/tree/master/components/camel-cassandraql
<https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
. This seems to be good candidate for my use case!
Use Case :
ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
ProcessA is responsible to write data continuously to apache cassandra and
in near realtime another process read/parse and send it to downstream
system.
Consumer :
https://github.com/oscerd/camel-cassandra/blob/master/src/main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
I want to start the Consumer Process which should run 24/7 and start
processing unless until it gets Kill Request..
Here is the Code i tried:
public class CassandraConsumer {
public static void main(String[] args) throws Exception {
CassandraEndpoint endpoint = new CassandraEndpoint();
endpoint.setPort("9042");
endpoint.setKeyspace("test");
endpoint.setHost("127.0.0.1");
endpoint.setTable("stream_data");
endpoint.setPollingQuery("select * from stream_data");
Processor p = new Processor() {
public void process(Exchange exchange) throws Exception {
ResultSet body = (ResultSet) exchange.getIn().getBody();
List<Row> allRows = body.all();
for(Row r : allRows ){
System.out.println(r.getInt("id")+" "+r.getString("data"));
}
}
};
endpoint.createConsumer(p).start();
}
}
This is not working ( I dont know how to use Consumer ).
Questions :
1) Can this Cassandra Camel Consumer opt for my Use Case ?
2) If Yes ( for above Q) , How to use Cassandra Consumer ? It would
be great if i get sample code !
--Senthil
Re: Re: Re: Streaming Cassandra Table ( Polling every 5s - Near
Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Sure , Let me learn and come back to forum if any questions!
--Senthil
On Thu, Jul 27, 2017 at 11:30 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> Maybe you need to learn a bit about camel. What camel is and what is a
> consumer.
> There is a lot of documentation on the website.
>
> Il mer, 26 lug, 2017 alle 21:15, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Not sure if i already have an answer... Still i'm not clear :-( ..
>
> Questions :
> 1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
> be great if i get sample code !*
>
>
>
> --Senthil
>
> On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
> wrote:
>
> > You already have an answer.
> >
> > Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> > <se...@gmail.com> ha scritto:
> > Ping !!!
> >
> > It would be great if anybody help me here :-) ..
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> > > Adding Dev Group ...
> > >
> > >
> > > --Senthil
> > >
> > > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <
> senthilec566@gmail.com>
> > > wrote:
> > >
> > >> Hello Camel Users , Recently i started exploring possibilities of
> > >> streaming data from Cassandra Table for my use case, found *
> > https://github.com/apache/camel/tree/master/components/camel-cassandraql
> > >> <https://github.com/apache/camel/tree/master/components/
> > camel-cassandraql>*
> >
> > >> . This seems to be good candidate for my use case!
> > >>
> > >>
> > >> Use Case :
> > >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> > System
> > >>
> > >> ProcessA is responsible to write data continuously to apache cassandra
> > >> and in near realtime another process read/parse and send it to
> > downstream
> > >> system.
> > >>
> > >> Consumer :
> > >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> > >> main/java/com/github/oscerd/component/cassandra/
> CassandraConsumer.java
> > >>
> > >> I want to start the Consumer Process which should run 24/7 and start
> > >> processing unless until it gets Kill Request..
> > >>
> > >> Here is the Code i tried:
> > >> public class CassandraConsumer {
> > >> public static void main(String[] args) throws Exception {
> > >> CassandraEndpoint endpoint = new CassandraEndpoint();
> > >> endpoint.setPort("9042");
> > >> endpoint.setKeyspace("test");
> > >> endpoint.setHost("127.0.0.1");
> > >> endpoint.setTable("stream_data");
> > >> endpoint.setPollingQuery("select * from stream_data");
> > >> Processor p = new Processor() {
> > >> public void process(Exchange exchange) throws Exception {
> > >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> > >> List<Row> allRows = body.all();
> > >> for(Row r : allRows ){
> > >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> > >> }
> > >> }
> > >> };
> > >> endpoint.createConsumer(p).start();
> > >> }
> > >> }
> > >>
> > >> This is not working ( I dont know how to use Consumer ).
> > >>
> > >> Questions :
> > >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> > >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> > >> would be great if i get sample code !
> > >>
> > >>
> > >> --Senthil
> > >>
> > >
> > >
> >
> >
>
>
Re: Re: Re: Streaming Cassandra Table ( Polling every 5s - Near
Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Sure , Let me learn and come back to forum if any questions!
--Senthil
On Thu, Jul 27, 2017 at 11:30 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> Maybe you need to learn a bit about camel. What camel is and what is a
> consumer.
> There is a lot of documentation on the website.
>
> Il mer, 26 lug, 2017 alle 21:15, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Not sure if i already have an answer... Still i'm not clear :-( ..
>
> Questions :
> 1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
> be great if i get sample code !*
>
>
>
> --Senthil
>
> On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
> wrote:
>
> > You already have an answer.
> >
> > Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> > <se...@gmail.com> ha scritto:
> > Ping !!!
> >
> > It would be great if anybody help me here :-) ..
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> > > Adding Dev Group ...
> > >
> > >
> > > --Senthil
> > >
> > > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <
> senthilec566@gmail.com>
> > > wrote:
> > >
> > >> Hello Camel Users , Recently i started exploring possibilities of
> > >> streaming data from Cassandra Table for my use case, found *
> > https://github.com/apache/camel/tree/master/components/camel-cassandraql
> > >> <https://github.com/apache/camel/tree/master/components/
> > camel-cassandraql>*
> >
> > >> . This seems to be good candidate for my use case!
> > >>
> > >>
> > >> Use Case :
> > >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> > System
> > >>
> > >> ProcessA is responsible to write data continuously to apache cassandra
> > >> and in near realtime another process read/parse and send it to
> > downstream
> > >> system.
> > >>
> > >> Consumer :
> > >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> > >> main/java/com/github/oscerd/component/cassandra/
> CassandraConsumer.java
> > >>
> > >> I want to start the Consumer Process which should run 24/7 and start
> > >> processing unless until it gets Kill Request..
> > >>
> > >> Here is the Code i tried:
> > >> public class CassandraConsumer {
> > >> public static void main(String[] args) throws Exception {
> > >> CassandraEndpoint endpoint = new CassandraEndpoint();
> > >> endpoint.setPort("9042");
> > >> endpoint.setKeyspace("test");
> > >> endpoint.setHost("127.0.0.1");
> > >> endpoint.setTable("stream_data");
> > >> endpoint.setPollingQuery("select * from stream_data");
> > >> Processor p = new Processor() {
> > >> public void process(Exchange exchange) throws Exception {
> > >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> > >> List<Row> allRows = body.all();
> > >> for(Row r : allRows ){
> > >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> > >> }
> > >> }
> > >> };
> > >> endpoint.createConsumer(p).start();
> > >> }
> > >> }
> > >>
> > >> This is not working ( I dont know how to use Consumer ).
> > >>
> > >> Questions :
> > >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> > >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> > >> would be great if i get sample code !
> > >>
> > >>
> > >> --Senthil
> > >>
> > >
> > >
> >
> >
>
>
R: Re: Re: Streaming Cassandra Table ( Polling every 5s - Near
Realtime )
Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
Maybe you need to learn a bit about camel. What camel is and what is a consumer.There is a lot of documentation on the website.
Il mer, 26 lug, 2017 alle 21:15, SenthilKumar K<se...@gmail.com> ha scritto: Not sure if i already have an answer... Still i'm not clear :-( ..
Questions :
1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
be great if i get sample code !*
--Senthil
On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> You already have an answer.
>
> Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Ping !!!
>
> It would be great if anybody help me here :-) ..
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
> > Adding Dev Group ...
> >
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> >> Hello Camel Users , Recently i started exploring possibilities of
> >> streaming data from Cassandra Table for my use case, found *
> https://github.com/apache/camel/tree/master/components/camel-cassandraql
> >> <https://github.com/apache/camel/tree/master/components/
> camel-cassandraql>*
>
> >> . This seems to be good candidate for my use case!
> >>
> >>
> >> Use Case :
> >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> System
> >>
> >> ProcessA is responsible to write data continuously to apache cassandra
> >> and in near realtime another process read/parse and send it to
> downstream
> >> system.
> >>
> >> Consumer :
> >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> >> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
> >>
> >> I want to start the Consumer Process which should run 24/7 and start
> >> processing unless until it gets Kill Request..
> >>
> >> Here is the Code i tried:
> >> public class CassandraConsumer {
> >> public static void main(String[] args) throws Exception {
> >> CassandraEndpoint endpoint = new CassandraEndpoint();
> >> endpoint.setPort("9042");
> >> endpoint.setKeyspace("test");
> >> endpoint.setHost("127.0.0.1");
> >> endpoint.setTable("stream_data");
> >> endpoint.setPollingQuery("select * from stream_data");
> >> Processor p = new Processor() {
> >> public void process(Exchange exchange) throws Exception {
> >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> >> List<Row> allRows = body.all();
> >> for(Row r : allRows ){
> >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> >> }
> >> }
> >> };
> >> endpoint.createConsumer(p).start();
> >> }
> >> }
> >>
> >> This is not working ( I dont know how to use Consumer ).
> >>
> >> Questions :
> >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> >> would be great if i get sample code !
> >>
> >>
> >> --Senthil
> >>
> >
> >
>
>
R: Re: Re: Streaming Cassandra Table ( Polling every 5s - Near
Realtime )
Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
Maybe you need to learn a bit about camel. What camel is and what is a consumer.There is a lot of documentation on the website.
Il mer, 26 lug, 2017 alle 21:15, SenthilKumar K<se...@gmail.com> ha scritto: Not sure if i already have an answer... Still i'm not clear :-( ..
Questions :
1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
be great if i get sample code !*
--Senthil
On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> You already have an answer.
>
> Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Ping !!!
>
> It would be great if anybody help me here :-) ..
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
> > Adding Dev Group ...
> >
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> >> Hello Camel Users , Recently i started exploring possibilities of
> >> streaming data from Cassandra Table for my use case, found *
> https://github.com/apache/camel/tree/master/components/camel-cassandraql
> >> <https://github.com/apache/camel/tree/master/components/
> camel-cassandraql>*
>
> >> . This seems to be good candidate for my use case!
> >>
> >>
> >> Use Case :
> >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> System
> >>
> >> ProcessA is responsible to write data continuously to apache cassandra
> >> and in near realtime another process read/parse and send it to
> downstream
> >> system.
> >>
> >> Consumer :
> >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> >> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
> >>
> >> I want to start the Consumer Process which should run 24/7 and start
> >> processing unless until it gets Kill Request..
> >>
> >> Here is the Code i tried:
> >> public class CassandraConsumer {
> >> public static void main(String[] args) throws Exception {
> >> CassandraEndpoint endpoint = new CassandraEndpoint();
> >> endpoint.setPort("9042");
> >> endpoint.setKeyspace("test");
> >> endpoint.setHost("127.0.0.1");
> >> endpoint.setTable("stream_data");
> >> endpoint.setPollingQuery("select * from stream_data");
> >> Processor p = new Processor() {
> >> public void process(Exchange exchange) throws Exception {
> >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> >> List<Row> allRows = body.all();
> >> for(Row r : allRows ){
> >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> >> }
> >> }
> >> };
> >> endpoint.createConsumer(p).start();
> >> }
> >> }
> >>
> >> This is not working ( I dont know how to use Consumer ).
> >>
> >> Questions :
> >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> >> would be great if i get sample code !
> >>
> >>
> >> --Senthil
> >>
> >
> >
>
>
Re: Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Not sure if i already have an answer... Still i'm not clear :-( ..
Questions :
1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
be great if i get sample code !*
--Senthil
On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> You already have an answer.
>
> Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Ping !!!
>
> It would be great if anybody help me here :-) ..
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
> > Adding Dev Group ...
> >
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> >> Hello Camel Users , Recently i started exploring possibilities of
> >> streaming data from Cassandra Table for my use case, found *
> https://github.com/apache/camel/tree/master/components/camel-cassandraql
> >> <https://github.com/apache/camel/tree/master/components/
> camel-cassandraql>*
>
> >> . This seems to be good candidate for my use case!
> >>
> >>
> >> Use Case :
> >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> System
> >>
> >> ProcessA is responsible to write data continuously to apache cassandra
> >> and in near realtime another process read/parse and send it to
> downstream
> >> system.
> >>
> >> Consumer :
> >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> >> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
> >>
> >> I want to start the Consumer Process which should run 24/7 and start
> >> processing unless until it gets Kill Request..
> >>
> >> Here is the Code i tried:
> >> public class CassandraConsumer {
> >> public static void main(String[] args) throws Exception {
> >> CassandraEndpoint endpoint = new CassandraEndpoint();
> >> endpoint.setPort("9042");
> >> endpoint.setKeyspace("test");
> >> endpoint.setHost("127.0.0.1");
> >> endpoint.setTable("stream_data");
> >> endpoint.setPollingQuery("select * from stream_data");
> >> Processor p = new Processor() {
> >> public void process(Exchange exchange) throws Exception {
> >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> >> List<Row> allRows = body.all();
> >> for(Row r : allRows ){
> >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> >> }
> >> }
> >> };
> >> endpoint.createConsumer(p).start();
> >> }
> >> }
> >>
> >> This is not working ( I dont know how to use Consumer ).
> >>
> >> Questions :
> >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> >> would be great if i get sample code !
> >>
> >>
> >> --Senthil
> >>
> >
> >
>
>
Re: Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Not sure if i already have an answer... Still i'm not clear :-( ..
Questions :
1) *Can this Cassandra Camel Consumer opt for my Use Case ?*
2) If Yes ( for above Q) , How to use Cassandra Consumer ? *It would
be great if i get sample code !*
--Senthil
On Thu, Jul 27, 2017 at 12:41 AM, Andrea Cosentino <an...@yahoo.com>
wrote:
> You already have an answer.
>
> Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K
> <se...@gmail.com> ha scritto:
> Ping !!!
>
> It would be great if anybody help me here :-) ..
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
> > Adding Dev Group ...
> >
> >
> > --Senthil
> >
> > On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> > wrote:
> >
> >> Hello Camel Users , Recently i started exploring possibilities of
> >> streaming data from Cassandra Table for my use case, found *
> https://github.com/apache/camel/tree/master/components/camel-cassandraql
> >> <https://github.com/apache/camel/tree/master/components/
> camel-cassandraql>*
>
> >> . This seems to be good candidate for my use case!
> >>
> >>
> >> Use Case :
> >> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics
> System
> >>
> >> ProcessA is responsible to write data continuously to apache cassandra
> >> and in near realtime another process read/parse and send it to
> downstream
> >> system.
> >>
> >> Consumer :
> >> https://github.com/oscerd/camel-cassandra/blob/master/src/
> >> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
> >>
> >> I want to start the Consumer Process which should run 24/7 and start
> >> processing unless until it gets Kill Request..
> >>
> >> Here is the Code i tried:
> >> public class CassandraConsumer {
> >> public static void main(String[] args) throws Exception {
> >> CassandraEndpoint endpoint = new CassandraEndpoint();
> >> endpoint.setPort("9042");
> >> endpoint.setKeyspace("test");
> >> endpoint.setHost("127.0.0.1");
> >> endpoint.setTable("stream_data");
> >> endpoint.setPollingQuery("select * from stream_data");
> >> Processor p = new Processor() {
> >> public void process(Exchange exchange) throws Exception {
> >> ResultSet body = (ResultSet) exchange.getIn().getBody();
> >> List<Row> allRows = body.all();
> >> for(Row r : allRows ){
> >> System.out.println(r.getInt("id")+" "+r.getString("data"));
> >> }
> >> }
> >> };
> >> endpoint.createConsumer(p).start();
> >> }
> >> }
> >>
> >> This is not working ( I dont know how to use Consumer ).
> >>
> >> Questions :
> >> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> >> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
> >> would be great if i get sample code !
> >>
> >>
> >> --Senthil
> >>
> >
> >
>
>
R: Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime
)
Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
You already have an answer.
Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K<se...@gmail.com> ha scritto: Ping !!!
It would be great if anybody help me here :-) ..
--Senthil
On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Adding Dev Group ...
>
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
>> Hello Camel Users , Recently i started exploring possibilities of
>> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
>> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
>> . This seems to be good candidate for my use case!
>>
>>
>> Use Case :
>> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>>
>> ProcessA is responsible to write data continuously to apache cassandra
>> and in near realtime another process read/parse and send it to downstream
>> system.
>>
>> Consumer :
>> https://github.com/oscerd/camel-cassandra/blob/master/src/
>> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>>
>> I want to start the Consumer Process which should run 24/7 and start
>> processing unless until it gets Kill Request..
>>
>> Here is the Code i tried:
>> public class CassandraConsumer {
>> public static void main(String[] args) throws Exception {
>> CassandraEndpoint endpoint = new CassandraEndpoint();
>> endpoint.setPort("9042");
>> endpoint.setKeyspace("test");
>> endpoint.setHost("127.0.0.1");
>> endpoint.setTable("stream_data");
>> endpoint.setPollingQuery("select * from stream_data");
>> Processor p = new Processor() {
>> public void process(Exchange exchange) throws Exception {
>> ResultSet body = (ResultSet) exchange.getIn().getBody();
>> List<Row> allRows = body.all();
>> for(Row r : allRows ){
>> System.out.println(r.getInt("id")+" "+r.getString("data"));
>> }
>> }
>> };
>> endpoint.createConsumer(p).start();
>> }
>> }
>>
>> This is not working ( I dont know how to use Consumer ).
>>
>> Questions :
>> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
>> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
>> would be great if i get sample code !
>>
>>
>> --Senthil
>>
>
>
R: Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime
)
Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
You already have an answer.
Il mer, 26 lug, 2017 alle 21:09, SenthilKumar K<se...@gmail.com> ha scritto: Ping !!!
It would be great if anybody help me here :-) ..
--Senthil
On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Adding Dev Group ...
>
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
>> Hello Camel Users , Recently i started exploring possibilities of
>> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
>> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
>> . This seems to be good candidate for my use case!
>>
>>
>> Use Case :
>> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>>
>> ProcessA is responsible to write data continuously to apache cassandra
>> and in near realtime another process read/parse and send it to downstream
>> system.
>>
>> Consumer :
>> https://github.com/oscerd/camel-cassandra/blob/master/src/
>> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>>
>> I want to start the Consumer Process which should run 24/7 and start
>> processing unless until it gets Kill Request..
>>
>> Here is the Code i tried:
>> public class CassandraConsumer {
>> public static void main(String[] args) throws Exception {
>> CassandraEndpoint endpoint = new CassandraEndpoint();
>> endpoint.setPort("9042");
>> endpoint.setKeyspace("test");
>> endpoint.setHost("127.0.0.1");
>> endpoint.setTable("stream_data");
>> endpoint.setPollingQuery("select * from stream_data");
>> Processor p = new Processor() {
>> public void process(Exchange exchange) throws Exception {
>> ResultSet body = (ResultSet) exchange.getIn().getBody();
>> List<Row> allRows = body.all();
>> for(Row r : allRows ){
>> System.out.println(r.getInt("id")+" "+r.getString("data"));
>> }
>> }
>> };
>> endpoint.createConsumer(p).start();
>> }
>> }
>>
>> This is not working ( I dont know how to use Consumer ).
>>
>> Questions :
>> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
>> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
>> would be great if i get sample code !
>>
>>
>> --Senthil
>>
>
>
Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Ping !!!
It would be great if anybody help me here :-) ..
--Senthil
On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Adding Dev Group ...
>
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
>> Hello Camel Users , Recently i started exploring possibilities of
>> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
>> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
>> . This seems to be good candidate for my use case!
>>
>>
>> Use Case :
>> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>>
>> ProcessA is responsible to write data continuously to apache cassandra
>> and in near realtime another process read/parse and send it to downstream
>> system.
>>
>> Consumer :
>> https://github.com/oscerd/camel-cassandra/blob/master/src/
>> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>>
>> I want to start the Consumer Process which should run 24/7 and start
>> processing unless until it gets Kill Request..
>>
>> Here is the Code i tried:
>> public class CassandraConsumer {
>> public static void main(String[] args) throws Exception {
>> CassandraEndpoint endpoint = new CassandraEndpoint();
>> endpoint.setPort("9042");
>> endpoint.setKeyspace("test");
>> endpoint.setHost("127.0.0.1");
>> endpoint.setTable("stream_data");
>> endpoint.setPollingQuery("select * from stream_data");
>> Processor p = new Processor() {
>> public void process(Exchange exchange) throws Exception {
>> ResultSet body = (ResultSet) exchange.getIn().getBody();
>> List<Row> allRows = body.all();
>> for(Row r : allRows ){
>> System.out.println(r.getInt("id")+" "+r.getString("data"));
>> }
>> }
>> };
>> endpoint.createConsumer(p).start();
>> }
>> }
>>
>> This is not working ( I dont know how to use Consumer ).
>>
>> Questions :
>> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
>> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
>> would be great if i get sample code !
>>
>>
>> --Senthil
>>
>
>
Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Ping !!!
It would be great if anybody help me here :-) ..
--Senthil
On Wed, Jul 26, 2017 at 4:47 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Adding Dev Group ...
>
>
> --Senthil
>
> On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
> wrote:
>
>> Hello Camel Users , Recently i started exploring possibilities of
>> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
>> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
>> . This seems to be good candidate for my use case!
>>
>>
>> Use Case :
>> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>>
>> ProcessA is responsible to write data continuously to apache cassandra
>> and in near realtime another process read/parse and send it to downstream
>> system.
>>
>> Consumer :
>> https://github.com/oscerd/camel-cassandra/blob/master/src/
>> main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>>
>> I want to start the Consumer Process which should run 24/7 and start
>> processing unless until it gets Kill Request..
>>
>> Here is the Code i tried:
>> public class CassandraConsumer {
>> public static void main(String[] args) throws Exception {
>> CassandraEndpoint endpoint = new CassandraEndpoint();
>> endpoint.setPort("9042");
>> endpoint.setKeyspace("test");
>> endpoint.setHost("127.0.0.1");
>> endpoint.setTable("stream_data");
>> endpoint.setPollingQuery("select * from stream_data");
>> Processor p = new Processor() {
>> public void process(Exchange exchange) throws Exception {
>> ResultSet body = (ResultSet) exchange.getIn().getBody();
>> List<Row> allRows = body.all();
>> for(Row r : allRows ){
>> System.out.println(r.getInt("id")+" "+r.getString("data"));
>> }
>> }
>> };
>> endpoint.createConsumer(p).start();
>> }
>> }
>>
>> This is not working ( I dont know how to use Consumer ).
>>
>> Questions :
>> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
>> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It
>> would be great if i get sample code !
>>
>>
>> --Senthil
>>
>
>
Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Adding Dev Group ...
--Senthil
On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Hello Camel Users , Recently i started exploring possibilities of
> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
> . This seems to be good candidate for my use case!
>
>
> Use Case :
> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>
> ProcessA is responsible to write data continuously to apache cassandra and
> in near realtime another process read/parse and send it to downstream
> system.
>
> Consumer :
> https://github.com/oscerd/camel-cassandra/blob/master/
> src/main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>
> I want to start the Consumer Process which should run 24/7 and start
> processing unless until it gets Kill Request..
>
> Here is the Code i tried:
> public class CassandraConsumer {
> public static void main(String[] args) throws Exception {
> CassandraEndpoint endpoint = new CassandraEndpoint();
> endpoint.setPort("9042");
> endpoint.setKeyspace("test");
> endpoint.setHost("127.0.0.1");
> endpoint.setTable("stream_data");
> endpoint.setPollingQuery("select * from stream_data");
> Processor p = new Processor() {
> public void process(Exchange exchange) throws Exception {
> ResultSet body = (ResultSet) exchange.getIn().getBody();
> List<Row> allRows = body.all();
> for(Row r : allRows ){
> System.out.println(r.getInt("id")+" "+r.getString("data"));
> }
> }
> };
> endpoint.createConsumer(p).start();
> }
> }
>
> This is not working ( I dont know how to use Consumer ).
>
> Questions :
> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It would
> be great if i get sample code !
>
>
> --Senthil
>
Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by Claus Ibsen <cl...@gmail.com>.
You need to keep the consumer running, so maybe your JVM terminate
after you call start as start is non blocking.
However with Camel you typically uses Camel routes to setup what you
want, and can then do a route that is
from cassandr
to bean or processor
To keep the JVM running see this FAQ
http://camel.apache.org/running-camel-standalone.html
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
Also you need to create a CamelContext etc. See the beginner examples,
https://github.com/apache/camel/tree/master/examples#examples
On Wed, Jul 26, 2017 at 11:44 AM, SenthilKumar K <se...@gmail.com> wrote:
> Hello Camel Users , Recently i started exploring possibilities of
> streaming data from Cassandra Table for my use case, found
> *https://github.com/apache/camel/tree/master/components/camel-cassandraql
> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
> . This seems to be good candidate for my use case!
>
>
> Use Case :
> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>
> ProcessA is responsible to write data continuously to apache cassandra and
> in near realtime another process read/parse and send it to downstream
> system.
>
> Consumer :
> https://github.com/oscerd/camel-cassandra/blob/master/src/main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>
> I want to start the Consumer Process which should run 24/7 and start
> processing unless until it gets Kill Request..
>
> Here is the Code i tried:
> public class CassandraConsumer {
> public static void main(String[] args) throws Exception {
> CassandraEndpoint endpoint = new CassandraEndpoint();
> endpoint.setPort("9042");
> endpoint.setKeyspace("test");
> endpoint.setHost("127.0.0.1");
> endpoint.setTable("stream_data");
> endpoint.setPollingQuery("select * from stream_data");
> Processor p = new Processor() {
> public void process(Exchange exchange) throws Exception {
> ResultSet body = (ResultSet) exchange.getIn().getBody();
> List<Row> allRows = body.all();
> for(Row r : allRows ){
> System.out.println(r.getInt("id")+" "+r.getString("data"));
> }
> }
> };
> endpoint.createConsumer(p).start();
> }
> }
>
> This is not working ( I dont know how to use Consumer ).
>
> Questions :
> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It would
> be great if i get sample code !
>
>
> --Senthil
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: Streaming Cassandra Table ( Polling every 5s - Near Realtime )
Posted by SenthilKumar K <se...@gmail.com>.
Adding Dev Group ...
--Senthil
On Wed, Jul 26, 2017 at 3:14 PM, SenthilKumar K <se...@gmail.com>
wrote:
> Hello Camel Users , Recently i started exploring possibilities of
> streaming data from Cassandra Table for my use case, found *https://github.com/apache/camel/tree/master/components/camel-cassandraql
> <https://github.com/apache/camel/tree/master/components/camel-cassandraql>*
> . This seems to be good candidate for my use case!
>
>
> Use Case :
> ProcessA --Write---> Cassandra <---READ--- ProcessB ---> Analytics System
>
> ProcessA is responsible to write data continuously to apache cassandra and
> in near realtime another process read/parse and send it to downstream
> system.
>
> Consumer :
> https://github.com/oscerd/camel-cassandra/blob/master/
> src/main/java/com/github/oscerd/component/cassandra/CassandraConsumer.java
>
> I want to start the Consumer Process which should run 24/7 and start
> processing unless until it gets Kill Request..
>
> Here is the Code i tried:
> public class CassandraConsumer {
> public static void main(String[] args) throws Exception {
> CassandraEndpoint endpoint = new CassandraEndpoint();
> endpoint.setPort("9042");
> endpoint.setKeyspace("test");
> endpoint.setHost("127.0.0.1");
> endpoint.setTable("stream_data");
> endpoint.setPollingQuery("select * from stream_data");
> Processor p = new Processor() {
> public void process(Exchange exchange) throws Exception {
> ResultSet body = (ResultSet) exchange.getIn().getBody();
> List<Row> allRows = body.all();
> for(Row r : allRows ){
> System.out.println(r.getInt("id")+" "+r.getString("data"));
> }
> }
> };
> endpoint.createConsumer(p).start();
> }
> }
>
> This is not working ( I dont know how to use Consumer ).
>
> Questions :
> 1) Can this Cassandra Camel Consumer opt for my Use Case ?
> 2) If Yes ( for above Q) , How to use Cassandra Consumer ? It would
> be great if i get sample code !
>
>
> --Senthil
>