Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
90cd6dcc
Commit
90cd6dcc
authored
Mar 15, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: shutdown & restart AMQ workers & connections more robustly
parent
c138507e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
amq.cpp
trackrdrd/src/activemq/amq.cpp
+5
-4
amq_connection.cpp
trackrdrd/src/activemq/amq_connection.cpp
+16
-0
No files found.
trackrdrd/src/activemq/amq.cpp
View file @
90cd6dcc
...
...
@@ -71,15 +71,16 @@ AMQ_Worker::AMQ_Worker(Connection* cn, std::string& qName,
}
AMQ_Worker
::~
AMQ_Worker
()
{
if
(
producer
!=
NULL
)
{
delete
producer
;
producer
=
NULL
;
}
if
(
queue
!=
NULL
)
{
delete
queue
;
queue
=
NULL
;
}
if
(
producer
!=
NULL
)
{
delete
producer
;
producer
=
NULL
;
}
if
(
session
!=
NULL
)
{
session
->
stop
();
delete
session
;
session
=
NULL
;
}
...
...
trackrdrd/src/activemq/amq_connection.cpp
View file @
90cd6dcc
...
...
@@ -30,6 +30,7 @@
*/
#include "amq_connection.h"
#include <decaf/lang/exceptions/NullPointerException.h>
#define CATCHALL \
catch (CMSException& cex) { \
...
...
@@ -49,14 +50,27 @@ using namespace std;
using
namespace
activemq
::
core
;
using
namespace
cms
;
using
namespace
decaf
::
lang
;
using
namespace
decaf
::
lang
::
exceptions
;
ActiveMQConnectionFactory
*
AMQ_Connection
::
factory
=
NULL
;
AMQ_Connection
::
AMQ_Connection
(
std
::
string
&
brokerURI
)
{
if
(
brokerURI
.
length
()
==
0
)
throw
IllegalArgumentException
(
__FILE__
,
__LINE__
,
"Broker URI is empty"
);
factory
=
new
ActiveMQConnectionFactory
(
brokerURI
);
if
(
factory
==
NULL
)
throw
NullPointerException
(
__FILE__
,
__LINE__
,
"Factory created for %s is NULL"
,
brokerURI
.
c_str
());
connection
=
factory
->
createConnection
();
if
(
connection
==
NULL
)
throw
NullPointerException
(
__FILE__
,
__LINE__
,
"Connection created for %s is NULL"
,
brokerURI
.
c_str
());
connection
->
start
();
}
...
...
@@ -67,6 +81,8 @@ AMQ_Connection::getConnection() {
AMQ_Connection
::~
AMQ_Connection
()
{
if
(
connection
!=
NULL
)
{
connection
->
stop
();
connection
->
close
();
delete
connection
;
connection
=
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment