Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 942689 Details for
Bug 1147968
Session.nextReceiver() with IMMEDIATE duration does not raise exception when connection is closed
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Reproducer
qpid-read.cpp (text/x-csrc), 3.08 KB, created by
Pavel Moravec
on 2014-09-30 12:32:33 UTC
(
hide
)
Description:
Reproducer
Filename:
MIME Type:
Creator:
Pavel Moravec
Created:
2014-09-30 12:32:33 UTC
Size:
3.08 KB
patch
obsolete
>#include <qpid/messaging/Address.h> >#include <qpid/messaging/Connection.h> >#include <qpid/messaging/Message.h> >#include <qpid/messaging/Receiver.h> >#include <qpid/messaging/Sender.h> >#include <qpid/messaging/Session.h> >#include <qpid/types/Variant.h> >#include <qpid/framing/FieldTable.h> >#include <qpid/management/Manageable.h> >#include <qpid/sys/Time.h> >#include <iostream> >#include <boost/algorithm/string/classification.hpp> >#include <boost/algorithm/string/split.hpp> >#include <boost/shared_ptr.hpp> >#include <boost/get_pointer.hpp> >#include <boost/lexical_cast.hpp> >#include <boost/make_shared.hpp> >#include <boost/format.hpp> >#include <vector> >#include <unistd.h> >#include <sys/time.h> > > >int main(int argc, char** argv) >{ > if(argc < 3) > { > std::cout << "Usage: qpid-read <brokerhost:brokerPort> <queuename> <capacity> " <<std::endl; > return 1; > } > std::string broker = argv[1]; > std::string address = argv[2]; > int capacity = boost::lexical_cast<int>(std::string(argv[3])); > > > using namespace qpid::messaging; > using namespace qpid::sys; > > Connection connection(broker); > try > { > connection.open(); > Session session = connection.createSession(); > Address addr (address); > Receiver receiver1 = session.createReceiver(addr); > receiver1.setCapacity(capacity); > Receiver receiver; > int total_msgs = 0; > > while (true) > { > try { >// if (session.nextReceiver(receiver, qpid::messaging::Duration::SECOND )) > if (session.nextReceiver(receiver, qpid::messaging::Duration::IMMEDIATE )) //qpid::messaging::MessagingException is not thrown >// if (session.nextReceiver(receiver, qpid::messaging::Duration(5/qpid::sys::TIME_USEC))) > { > try > { > qpid::messaging::Message msg; > if (receiver.get(msg,qpid::messaging::Duration::IMMEDIATE)) > { > std::cout << "Reading Message. Total: " << ++total_msgs << std::endl; > } > session.acknowledge(); > } > > catch (const qpid::messaging::MessagingException& e) > { > std::cout << "MessagingException in Reader - 1." << std::endl; > } > catch(...) > { > std::cout << "Exception in Reader." << std::endl; > } > } > else > { > qpid::sys::usleep (5/qpid::sys::TIME_USEC); > } > } //End while > > catch (const qpid::messaging::MessagingException& e) > { > std::cout << "MessagingException in Reader - 2." << std::endl; > connection.close(); > return 1; > } > catch(...) > { > std::cout << "Exception in Reader - 2." << std::endl; > } > } > > connection.close(); > return 0; > } > > catch (const qpid::messaging::MessagingException& e) > { > std::cout << "MessagingException in Reader - 3." << std::endl; > connection.close(); > return 1; > } > catch(const std::exception& error) > { > std::cout << "std::exception: " << error.what() << std::endl; > connection.close(); > return 1; > } > catch(...) > { > std::cout << "something bad happened." << std::endl; > connection.close(); > return 1; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1147968
: 942689