ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportGetting host/port of Database Retrieve node using user exit.

Post new topicReply to topic
Getting host/port of Database Retrieve node using user exit. View previous topic :: View next topic
Author Message
tyroneyu
PostPosted: Tue Jul 24, 2018 2:36 pm Post subject: Getting host/port of Database Retrieve node using user exit. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jul 25, 2018 4:42 am Post subject: Re: Getting host/port of Database Retrieve node using user e Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25244
Location: Ohio, 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
View user's profile Send private message
tyroneyu
PostPosted: Wed Jul 25, 2018 1:58 pm Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Thu Jul 26, 2018 4:45 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25244
Location: Ohio, 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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportGetting host/port of Database Retrieve node using user exit.
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.