Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gmsec_kafka
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Reis
gmsec_kafka
Commits
5f9040be
Commit
5f9040be
authored
Feb 13, 2017
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added error detection in Recieve
parent
34bb81bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
KafkaConnection.cpp
src/KafkaConnection.cpp
+12
-7
No files found.
src/KafkaConnection.cpp
View file @
5f9040be
...
...
@@ -330,10 +330,10 @@ void KafkaConnection::mwPublish(const Message& message, const Config& config)
producer
->
poll
(
0
);
}
while
(
run
&&
producer
->
outq_len
()
>
0
)
{
std
::
cerr
<<
"Waiting for "
<<
producer
->
outq_len
()
<<
std
::
endl
;
producer
->
poll
(
250
);
}
//
while (run && producer->outq_len() > 0) {
//
std::cerr << "Waiting for " << producer->outq_len() << std::endl;
//
producer->poll(250);
//
}
GMSEC_DEBUG
<<
"gmsec_kafka:KafkaConnection::Publish(things)"
<<
'\n'
<<
message
.
toXML
()
;
}
...
...
@@ -351,7 +351,7 @@ void KafkaConnection::mwReply(const Message& request, const Message& reply)
void
KafkaConnection
::
mwReceive
(
Message
*&
message
,
GMSEC_I32
timeout
)
{
GMSEC_DEBUG
<<
"gmsec_kafka:KafkaConnection::mwReceive"
;
static
std
::
string
MSG_END
=
"</MESSAGE>"
;
message
=
NULL
;
RdKafka
::
Message
*
msg
=
consumer
->
consume
(
rkqu
,
(
int
)
timeout
);
...
...
@@ -360,8 +360,13 @@ void KafkaConnection::mwReceive(Message*& message, GMSEC_I32 timeout)
if
(
msg_str
.
find
(
"Broker:"
)
!=
string
::
npos
)
{
GMSEC_INFO
<<
msg_str
.
c_str
();
}
else
{
GMSEC_INFO
<<
'\n'
<<
msg_str
.
c_str
();
message
=
new
Message
(
msg_str
.
c_str
());
//Error Checking
std
::
size_t
found
=
msg_str
.
find
(
MSG_END
);
if
((
found
+
MSG_END
.
length
())
!=
msg_str
.
length
())
{
GMSEC_DEBUG
<<
"We have issues:"
<<
msg_str
.
substr
(
found
.
c_str
());
}
else
{
message
=
new
Message
(
msg_str
.
c_str
());
}
}
//msg_consume(msg, 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