activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Is there any data streaming example ?
Date Thu, 24 Sep 2015 21:58:36 GMT
On 09/24/2015 05:47 PM, mfan wrote:
> I am trying to stream growing data using activemq-cpp, but not able to
> succeed, can I get an example which I can put inside the Producer::run() for
> streaming a growing file which contains a simple text format like this below
> ?
> 1, S2,i231.1das.j4
> 2, S4,i123.5das.j2
> .....
> .....
> For now I just have read the whole file and have the producer send the text
> message like this in below.  With the PERSISTENT delivery mode, all the
> messages supposed to receive were received, however, with the
> NON_PERSISTENT, consumer stop receiving in the middle.  I would like to know
> why it stop receiving, and also the ultimate goal is to produce for a
> growing file, not the whole file at one time.  If I can be provided an
> example code for streaming/reading the growing file with activemq-cpp, I
> would appreciate it.
>
> infile = "filename";
> ifstream ifs(infile.c_str());
> while (ifs)
> {
>       getline(ifs, line);
>       std::cout << "produce : " << line << "\n";
>       std::unique_ptr<TextMessage>
> message(session->createTextMessage(line));
>       producer->send(message.get());
> }
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Is-there-any-data-streaming-example-tp4702276.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
That sort of thing is outside the scope of the ActiveMQ-CPP library,
it's purpose is to produce and consumer messages from the broker, the
rest is application logic that you'd need to implement in a way best
suited to your use case. 

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.redhat.com 
twitter: @tabish121
blog: http://timbish.blogspot.com/


Mime
View raw message