activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfan <chaome...@gmail.com>
Subject Is there any data streaming example ?
Date Thu, 24 Sep 2015 21:47:36 GMT
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.

Mime
View raw message