summaryrefslogtreecommitdiff
path: root/cpp/src/qmf/ResilientConnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qmf/ResilientConnection.cpp')
-rw-r--r--cpp/src/qmf/ResilientConnection.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/cpp/src/qmf/ResilientConnection.cpp b/cpp/src/qmf/ResilientConnection.cpp
index be7837b829..b3735657af 100644
--- a/cpp/src/qmf/ResilientConnection.cpp
+++ b/cpp/src/qmf/ResilientConnection.cpp
@@ -65,13 +65,12 @@ namespace qmf {
client::Connection& connection;
client::Session session;
client::SubscriptionManager* subscriptions;
+ string userId;
void* userContext;
vector<string> dests;
qpid::sys::Thread thread;
- RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc) :
- connImpl(ci), name(n), connection(c), session(connection.newSession(name)),
- subscriptions(new client::SubscriptionManager(session)), userContext(uc), thread(*this) {}
+ RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc);
~RCSession();
void received(client::Message& msg);
void run();
@@ -135,6 +134,14 @@ ResilientConnectionEvent ResilientConnectionEventImpl::copy()
return item;
}
+RCSession::RCSession(ResilientConnectionImpl& ci, const string& n, client::Connection& c, void* uc) :
+ connImpl(ci), name(n), connection(c), session(connection.newSession(name)),
+ subscriptions(new client::SubscriptionManager(session)), userContext(uc), thread(*this)
+{
+ const qpid::client::ConnectionSettings& operSettings = connection.getNegotiatedSettings();
+ userId = operSettings.username;
+}
+
RCSession::~RCSession()
{
subscriptions->stop();
@@ -254,6 +261,8 @@ void ResilientConnectionImpl::sendMessage(SessionHandle handle, qmf::Message& me
string data(message.body, message.length);
msg.getDeliveryProperties().setRoutingKey(message.routingKey);
msg.getMessageProperties().setReplyTo(qpid::framing::ReplyTo(message.replyExchange, message.replyKey));
+ if (settings.impl->getSendUserId())
+ msg.getMessageProperties().setUserId(sess->userId);
msg.setData(data);
try {