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
cc364bd8
Commit
cc364bd8
authored
Jan 16, 2017
by
Christopher Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Kafka Library
parent
78910c07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
Makefile
Makefile
+5
-1
KafkaConnection.cpp
src/KafkaConnection.cpp
+20
-1
No files found.
Makefile
View file @
cc364bd8
...
@@ -14,9 +14,13 @@ TARGET = lib$(LIBROOTNAME).$(SHLIB_EXT)
...
@@ -14,9 +14,13 @@ TARGET = lib$(LIBROOTNAME).$(SHLIB_EXT)
OBJDIR
=
./src
OBJDIR
=
./src
SUPDIR
=
$(SUPPORT)
/kafka
LOCAL_DEFS
=
-DGMSEC_LIBROOTNAME
=
$(LIBROOTNAME)
LOCAL_DEFS
=
-DGMSEC_LIBROOTNAME
=
$(LIBROOTNAME)
LOCAL_INCS
=
-I
./include
LOCAL_INCS
=
-I
$(GMSEC_HOME)
/include
\
-I
$(SUPDIR)
/include
\
-I
./include
CXXFLAGS
+=
$(LOCAL_DEFS)
$(LOCAL_INCS)
CXXFLAGS
+=
$(LOCAL_DEFS)
$(LOCAL_INCS)
...
...
src/KafkaConnection.cpp
View file @
cc364bd8
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <gmsec_version.h>
#include <gmsec_version.h>
#include <rdkafka.h>
using
namespace
gmsec
::
api
;
using
namespace
gmsec
::
api
;
using
namespace
gmsec
::
api
::
internal
;
using
namespace
gmsec
::
api
::
internal
;
...
@@ -40,6 +41,23 @@ using namespace gmsec::api::util;
...
@@ -40,6 +41,23 @@ using namespace gmsec::api::util;
using
namespace
std
;
using
namespace
std
;
/**
* Message delivery report callback.
* Called once for each message.
* See rdkafka.h for more information.
*/
static
void
msg_delivered
(
rd_kafka_t
*
rk
,
void
*
payload
,
size_t
len
,
int
error_code
,
void
*
opaque
,
void
*
msg_opaque
)
{
if
(
error_code
)
fprintf
(
stderr
,
"%% Message delivery failed: %s
\n
"
,
rd_kafka_err2str
(
error_code
));
else
if
(
!
quiet
)
fprintf
(
stderr
,
"%% Message delivered (%zd bytes): %.*s
\n
"
,
len
,
(
int
)
len
,
(
const
char
*
)
payload
);
}
KafkaConnection
::
KafkaConnection
(
const
Config
&
config
)
KafkaConnection
::
KafkaConnection
(
const
Config
&
config
)
:
:
...
@@ -47,6 +65,7 @@ KafkaConnection::KafkaConnection(const Config& config)
...
@@ -47,6 +65,7 @@ KafkaConnection::KafkaConnection(const Config& config)
mwInfo
(
""
)
mwInfo
(
""
)
{
{
GMSEC_DEBUG
<<
"Connection"
<<
'\n'
;
GMSEC_DEBUG
<<
"Connection"
<<
'\n'
;
}
}
KafkaConnection
::~
KafkaConnection
()
KafkaConnection
::~
KafkaConnection
()
...
@@ -91,7 +110,7 @@ void KafkaConnection::mwUnsubscribe(const char *subject)
...
@@ -91,7 +110,7 @@ void KafkaConnection::mwUnsubscribe(const char *subject)
void
KafkaConnection
::
mwPublish
(
const
Message
&
message
,
const
Config
&
config
)
void
KafkaConnection
::
mwPublish
(
const
Message
&
message
,
const
Config
&
config
)
{
{
GMSEC_DEBUG
<<
"gmsec_kafka:KafkaConnection::Publish(things)"
;
GMSEC_DEBUG
<<
"gmsec_kafka:KafkaConnection::Publish(things)"
<<
message
.
toXML
()
;
}
}
void
KafkaConnection
::
mwRequest
(
const
Message
&
message
,
std
::
string
&
id
)
void
KafkaConnection
::
mwRequest
(
const
Message
&
message
,
std
::
string
&
id
)
...
...
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