We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Now I have removed the thread but still the same behavior exist
#include <iostream> #include <uv.h> #include <string> #include <amqpcpp.h> #include <amqpcpp/libuv.h> #include <thread> #include <mutex> #include <iomanip> #include <unistd.h> using namespace std; using namespace AMQP; class RabbitMQPublisher { protected: LibUvHandler *ConnectionHandler; TcpConnection *Connection; TcpChannel *Channel; string exchangeName = "first-publish-exchange"; string queueName = "first-publish-queue"; string routingKey = "first-publish-exchange"; mutex ChannelLock; public: RabbitMQPublisher(uv_loop_t *Loop); virtual bool Publish(string message); virtual ~RabbitMQPublisher (){} }; RabbitMQPublisher::RabbitMQPublisher(uv_loop_t *Loop) { ConnectionHandler = new LibUvHandler(Loop); Connection = new TcpConnection(ConnectionHandler, Address("amqp://windows:[email protected]/")); Channel = new TcpChannel(Connection); Channel->declareQueue(queueName); Channel->declareExchange(exchangeName, AMQP::direct).onSuccess ([]{ cout << endl << "Exchange Declared" << endl; }); Channel->bindQueue(exchangeName, queueName, routingKey); } bool RabbitMQPublisher :: Publish(string message) { ChannelLock.lock(); Channel->publish(exchangeName, routingKey, message, message.size()); ChannelLock.unlock(); return true; } int main() { uv_loop_t *Loop = uv_default_loop(); RabbitMQPublisher Publisher(Loop); stringstream ss; for (int i=0;i<5000;i++) ss << hex << setw(2) << setfill('0') << i; string message = ss.str(); for (int i=0;i<5;i++) { //Publisher.Publish("Hi How Are You!!!"); // If I Send this message then every thing works fine Publisher.Publish(message); // But in this case connection to the queue breaks } uv_run(Loop, UV_RUN_DEFAULT); }
Originally posted by @dheeraj12190 in #451 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Now I have removed the thread but still the same behavior exist
Originally posted by @dheeraj12190 in #451 (comment)
The text was updated successfully, but these errors were encountered: