Skip to content
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

Non-Message callbacks not routed correctly #217

Open
louissobel opened this issue Dec 30, 2024 · 0 comments
Open

Non-Message callbacks not routed correctly #217

louissobel opened this issue Dec 30, 2024 · 0 comments

Comments

@louissobel
Copy link
Contributor

There's a few issues with how callbacks are routed from the single MQCALLBACK_Go entrypoint to the user-specified go callback function:

  • if any connection-wide "Event Handler" callback is registered, it will get called for an event (like, say, MQRC_CONNECTION_BROKEN) once for each queue-specific callback that's also registered
  • if any connection-wide "Event Handler" callback is registered, all callback-specific events requested via MQCBDO_ (like MQCBDO_START) will get routed to it rather than to the specific registered callbacks
  • if no connection-wide "Event Hander" callback is registered, then all the other events (MQCBDO_START etc) get dropped.
  • MQCBDO_REGISTER events could be dropped completely, as items aren't added to the cbMap structure until after the underlying CB call

The root of most of these is that the cbMap is indexed by hConn, hObj, but calltypes other than MESSAGE_REMOVED seem to omit the hObj, so the key that gets computed (https://github.com/ibm-messaging/mq-golang/blob/master/ibmmq/mqicb.go#L101) sometimes points at the wrong callback, or sometimes the fallback branch is taken when it should not be (https://github.com/ibm-messaging/mq-golang/blob/master/ibmmq/mqicb.go#L111).

One possible fix for this would be to instead index the cbMap by some opaque pointer that can be passed through the C MQCBD structure. Proof of concept here: master...louissobel:mq-golang:louis-fix-callbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant