Message Callback Functionality Implementation in Deep Stream Test Apps

Hi,

If anyone has implemented the message callback functionality in test app 4( deep stream_4.0) can share their function source code? I’m running test app 4 using kafka and wants to catch and display the acknowledgement sent to publisher from the server when messages are sent.

HI
I’m running test app 4 using kafka and wants to catch and display the acknowledgement sent to publisher from the server when messages are sent.

what does this mean? can you explain more detailed? thanks.

The app acts as a publisher as the msgbroker plugin sends data to the server. As explained in Kafka documentation that when server/broker receives a message from the publisher it sends back an acknowledgment informing publisher that it had received the message. So, similarly in that app, data is being send to kafka server so there must be some acknowledgements sent back to that publisher( app in current case). I want to capture those acknowledgements and want to display them on linux terminal.

Just now, I have used this struct in gstnvmsgbroker.h file:

struct _GstNvMsgBroker
{
GstBaseSink parent;

GQuark dsMetaQuark;
gpointer libHandle;
gchar *configFile;
gchar *protoLib;
gchar *connStr;
gchar *topic;
guint compId;
GMutex flowLock;
GCond flowCond;
GThread *doWorkThread;
gboolean isRunning;
gboolean asyncSend;
gint pendingCbCount;
NvDsMsgApiHandle connHandle;
NvDsMsgApiErrorType lastError;
nvds_msgapi_connect_ptr nvds_msgapi_connect;
nvds_msgapi_send_ptr nvds_msgapi_send;
nvds_msgapi_send_async_ptr nvds_msgapi_send_async;
nvds_msgapi_do_work_ptr nvds_msgapi_do_work;
nvds_msgapi_disconnect_ptr nvds_msgapi_disconnect;
};

and have created instance of this structure in my app and have assigned it to msgbroker:

GstNvMsgBroker *obj=(GstNvMsgBroker *) msgbroker ;

And printing attributes using:

g_print(“Pending counts:%u\n”,obj->pendingCbCount);
g_print(“Threads Running: %d\n”,obj->isRunning);
g_print(“Async no. of messages send: %u\n”,obj->asyncSend);
g_print (“Comp ID: %u\n”,obj->compId);

And I do am getting some resonable results on screen

HI
you can check this,
sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.c:44 nvds_msgapi_send_callback (void *data, NvDsMsgApiErrorType status)