|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting host/port of Database Retrieve node using user exit. |
« View previous topic :: View next topic » |
Author |
Message
|
tyroneyu |
Posted: Tue Jul 24, 2018 2:36 pm Post subject: Getting host/port of Database Retrieve node using user exit. |
|
|
Newbie
Joined: 24 Jul 2018 Posts: 2
|
Hello,
Preface: I would like to know the target database host/port. I'm using a user exit because I cannot modify existing flows. The user exit is intended to be put on existing installations for monitoring.
The only relevant node attribute I could find in the docs was the Data Source Name. This is the alias to the JDBCProviders configurable service. (Incidentally, the doc lists "dataSource" and is incorrect, cniGetNodeAttribute() required the keyword "dataSourceName").
1. I found the cniGetResourceProperty() API, however, what is the "resourceManager"?
CciSize cniGetResourceProperty(
int* returnCode,
CciChar* resourceManager,
CciChar* propertyName,
CciChar* value,
CciSize length);
2. The only other idea I had was to run
"iib mqsireportproperties node1 -c JDBCProviders -o AllReportableEntityNames -r" (with popen or boost.process) in bipInitializeUserExits() and parse the output. With that I can create a lookup table for the dataSourceNames. I do NOT like the idea of executing this on the command line and am hoping for any ideas.
Thanks! |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 25, 2018 4:42 am Post subject: Re: Getting host/port of Database Retrieve node using user e |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
tyroneyu wrote: |
I do NOT like the idea of executing this on the command line and am hoping for any ideas. |
Given the chaos & misery you can cause with a user exit that has one trivial coding issue, I'd absolutely use the command (which is intended for the use case you outline)
What causes you to find it unpalatable? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
tyroneyu |
Posted: Wed Jul 25, 2018 1:58 pm Post subject: |
|
|
Newbie
Joined: 24 Jul 2018 Posts: 2
|
It seems backwards to me to run a shell command(mqsireportproperties) from the user exit rather than using the supposedly equivalent API (cniGetResourceProperty).
I've gone ahead and coded up the shell command in my user exit. While it's still backwards to me, it works.
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 26, 2018 4:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
tyroneyu wrote: |
It seems backwards to me to run a shell command(mqsireportproperties) from the user exit rather than using the supposedly equivalent API (cniGetResourceProperty). |
[/quote]
Sorry - what I meant was why use a user exit at all!
A user exit in IIB is not a good thing; I accept your example is fairly vanilla but what I was getting at was why use an exit at all. Why not simply run the report command external to IIB and avoid the risk of a user exit? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|