-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: pubsub over amqp #3850
base: master
Are you sure you want to change the base?
WIP: pubsub over amqp #3850
Conversation
Maybe resolve the compile issues by using "libqpid-proton11-dev" and find_package()? Then there is no need to include all the sources in the open62541-project. mbedTLS is included the same way at the moment. |
Hey there! Wow, this looks good! Most systems can install proton as a dependency. https://packages.debian.org/stable/libs/libqpid-proton-cpp12 We can have a closer look when the line-count when only the changes to open62541 itself are in the PR. |
dfd1771
to
40f8d9a
Compare
Proton lib is linked using findPackage(). The previous commit is removed. PR rebased |
Thanks. We will review when the [WIP] is removed from the title. |
Signed-off-by: Waheed Ejaz <[email protected]>
Signed-off-by: Waheed Ejaz <[email protected]>
Signed-off-by: Waheed Ejaz <[email protected]>
Signed-off-by: Waheed Ejaz <[email protected]>
yield immedietly after amqp link open disconnect and delete amqp properly Signed-off-by: Waheed Ejaz <[email protected]>
Signed-off-by: Waheed Ejaz <[email protected]>
5f47581
to
777c9c1
Compare
|
||
if(!ua_amqpChannel || !amqpCtx){ | ||
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "PubSub AMQP Connection creation failed. Out of memory."); | ||
UA_Destroy_AmqpChannel(ua_amqpChannel, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this leak amqpCtx on the error path (potentially)?
|
||
if(!amqpCtx->ua_connection || !amqpCtx->driver) { | ||
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "PubSub AMQP: Context creation failed. Out of memory."); | ||
UA_Destroy_AmqpChannel(ua_amqpChannel, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here. amqpCtx and either ua_connection or driver would leak?
} else { | ||
UA_LOG_ERROR(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, | ||
"PubSub AMQP Connection creation failed. Invalid Address."); | ||
return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaks resources
I tested your code but realised that the prefix opc.amqp:https://xxx.xxx.xxx.xxx:5672 was not changed to opc.tcp:https://xxx.xxx.xxx.xxx:5672 during runtime. To force the test to continue, i manually set the prefix to opc.tcp:https://.... [2021-04-30 07:25:59.616 (UTC+0800)] error/server ua_amqp_adaptor.c :: yieldAmqp: _write failed. ret_code=BadConnectionClosed on closer look, the error is due to ctx->ua_connection.state returning a value of 1 In yieldAmqp function: inspecting ctx->ua_connection 0 = UA_CONNECTIONSTATE_CLOSED : The socket has been closed and the connection will be deleted ctx->ua_connection.channel : 0 NB: open62541.c : UA_ClientConnectionTCP_init() : add the following statement at the end of this function: connection.sockfd = socket(AF_INET, SOCK_STREAM, 0); |
Up for the initial review.
Basic PubSub publish over AMQP is added, works with ay AMQP 1.0 broker
NOTE:
The build system is adapted to link the qpid proton lib. At the moment proton c doesn't successfully build using all the warnings enabled in the open62541 build. This will be fixed later.
#3849