summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf2/examples
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/bindings/qmf2/examples')
-rw-r--r--cpp/bindings/qmf2/examples/cpp/agent.cpp6
-rwxr-xr-xcpp/bindings/qmf2/examples/python/agent.py3
2 files changed, 4 insertions, 5 deletions
diff --git a/cpp/bindings/qmf2/examples/cpp/agent.cpp b/cpp/bindings/qmf2/examples/cpp/agent.cpp
index e680ffeeeb..3ec42c8d86 100644
--- a/cpp/bindings/qmf2/examples/cpp/agent.cpp
+++ b/cpp/bindings/qmf2/examples/cpp/agent.cpp
@@ -60,7 +60,7 @@ ExampleAgent::ExampleAgent(const string& url)
//
// Create and open a messaging connection to a broker.
//
- connection = qpid::messaging::Connection(url);
+ connection = qpid::messaging::Connection(url, "{reconnect:True}");
connection.open();
//
@@ -132,7 +132,7 @@ void ExampleAgent::populateData()
//
// Create a control object and give it to the agent session to manage.
//
- control = Data(sch_control.getSchemaId());
+ control = Data(sch_control);
control.setProperty("state", "OPERATIONAL");
control.setProperty("methodCount", 0);
controlAddr = session.addData(control, "singleton");
@@ -178,7 +178,7 @@ bool ExampleAgent::method(AgentEvent& event)
if (event.getArguments()["useString"])
session.raiseException(event, event.getArguments()["stringVal"]);
else {
- Data ex(sch_exception.getSchemaId());
+ Data ex(sch_exception);
ex.setProperty("whatHappened", "It Failed");
ex.setProperty("howBad", 75);
ex.setProperty("details", event.getArguments()["details"]);
diff --git a/cpp/bindings/qmf2/examples/python/agent.py b/cpp/bindings/qmf2/examples/python/agent.py
index d354106042..84d2fe4615 100755
--- a/cpp/bindings/qmf2/examples/python/agent.py
+++ b/cpp/bindings/qmf2/examples/python/agent.py
@@ -34,7 +34,7 @@ class ExampleAgent(AgentHandler):
##
## Create and open a messaging connection to a broker.
##
- self.connection = cqpid.Connection(url)
+ self.connection = cqpid.Connection(url, "{reconnect:True}")
self.session = None
self.connection.open()
@@ -42,7 +42,6 @@ class ExampleAgent(AgentHandler):
## Create, configure, and open a QMFv2 agent session using the connection.
##
self.session = AgentSession(self.connection, "{interval:30}")
- self.session.setDomain("test")
self.session.setVendor('profitron.com')
self.session.setProduct('blastinator')
self.session.setAttribute('attr1', 1000)