On 08/21/2015 04:24 PM, mfan wrote:
> I am new to the ActiveMQ-CPP, here below was the problem I used the example
> from here - http://activemq.apache.org/cms/example.html.
>
> I tested it using a simple code in below for producer. About right after the
> producer finished reading, the customer code stops without finish, do
> anybody know what I have done wrong ?
>
> -------------Producer code to reading a file ------------------------- 
> std::ifstream ifs("largefile.txt"); 
> std::string line; 
> while (ifs) {
>    getline(ifs, line);
>    std::cout << "produce : " << line << "\n";
>    std::unique_ptr<TextMessage> message(session->createTextMessage(line));
>    producer->send(message.get());
> }
>
> Thanks.
>
>
>
> --
> View this message in context: 
> http://activemq.2283324.n4.nabble.com/Why-does-consumer-stop-receiving-message-using-ActiveMQ-cpp-example-tp4701292.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
There's really not enough to go on here, the question is a bit tough to
parse.  My first guess would be that you have produced to the point that
flow control kicks in and blocks the producer from sending more
information but we'd need more information to go on, a working sample is
always a good way to get help, broker logs can provide insight into what
is happening as well, check there for producer being blocked.

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

Reply via email to