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 Index » WebSphere Message Broker (ACE) Support » Where am I?

Post new topic  Reply to topic Goto page 1, 2  Next
 Where am I? « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Mon Nov 10, 2014 6:48 pm    Post subject: Where am I? Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

What do you guys use to allow the exact same BAR file to be deployed to your different Brokers, and have conditional ESQL code execute based on the environment the flow was deployed to?

For example, if the flow was deployed to the QA Broker, the code would execute some logic specific to the QA environment, but if it was deployed to a Prod Broker, it does Prod specific stuff. 99.99% of the flow would be the same in all environments, but simple stuff like a URL to post to or Reply To Q name to use might be different for that flow between environments.

You can't convince me User Defined Properties that you change on the bar file as it gets deployed to different Brokers is the same unaltered bar file.

This list shows which properties are available to ESQL:
http://www-01.ibm.com/support/knowledgecenter/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ak04897_.htm?lang=en

While we have a strong naming convention for our Broker names, I don't want this logic based on broker names. If we code it for specific names, we will have hundreds of flows to change if we ever want to scale horizontally and add one more Broker. We could rely on the naming pattern (if the 3rd character of the broker name is a "P" its Production), but I don't want to tie myself to that naming convention for eternity.

What do you guys use to answer a message flow if it asks "Where am I?"

I was hoping ESQL could query an environmental variable that is set at build time, as in SET MQSI_ENVIRONMENT=INTEGRATION

I do not want to use JCNs.

I guess we could use a File and stick a File Input Node in each flow - ugh. Would that even work at Broker startup when all the flows fire up at once? Don't wanna go there.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 10, 2014 7:40 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

What's wrong with a UDP?
Using mqsiapplybaroverride will change the value. So you start from the exact same bar file but the deployable is targetted for a specific environment.
The environment name would then be supplied in the bar override file.

Is this too far fetched?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Mon Nov 10, 2014 11:18 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

We use a table with one row for each flow. The flow reads it on startup and then it is cached in a shared variable. Thus any changes mean just a flow restart.

I'm using this at the moment to deploy some flows that have some functionality disabled. When the destination has their equivalent functionality ready to go I can use change the column in the table and restart the flow. If things go wrong then disabling it is easy.

We hold all sorts of params in different table columns. There has been a push to replace it all with a simpler table using key/value pairs but it is not as easy to use as what we have now. The only advantage is expandability but as we have not had to change the table structure in more than 2 years, I'd say that it is working well.
That said, we will probably add some extra columns for the next big project but it will always be backwards compatible.

We don't allow any Barfile overrides or UDP's. The barfile that goes through test is what is deployed. I know this is very 'old school' but we know for sure what has been deployed.
We tried Implementing Overrides once and the override file that was shipped to Japan was for a system in Indonesia. Trying to run the flow with Indonesia queue names was not a pleasant experience. Yes I know thjat this can be overcome but there was a lot of 'egg on face' and in a society like Japan this is very important to avoid if possible.

Broker allows us to do things in many different ways. We should use the way that works for you. no one way is correct.

Just my 2p's worth.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Nov 11, 2014 5:06 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

fjb_saper wrote:
What's wrong with a UDP?
Using mqsiapplybaroverride will change the value. So you start from the exact same bar file but the deployable is targetted for a specific environment.
The environment name would then be supplied in the bar override file.

Is this too far fetched?


Its a change. You are not deploying the same exact bar file to PROD as your are in QA. I understand the concept, I appreciate the flexibility UDPs offer, I get that its WAY better then cracking open the source code to change a parm or two and then re-bar it. But its involves a human getting involved to set all those UDPs each and every time the message flow is deployed for its lifetime, multiplied by hundreds of bar files.

I want to get to the point where the only decision is which bar file do I pull from the Source Repository, what time does the deploy fire and to which EG on which Broker - no other changes, no other thinking required by the deployers.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Nov 11, 2014 5:20 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

smdavies99 wrote:
We use a table with one row for each flow. The flow reads it on startup and then it is cached in a shared variable. Thus any changes mean just a flow restart.


Where is the table? In a DB on a non Broker server, and you rely on DSNs to get your flow on the QA server to refer to the QA database? On the PROD server to refer to the PROD database?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 11, 2014 6:15 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Even with UDPs, you could deploy the *same* bar file with the *same* values in the UDPs, and then update the UDPs on the deployed resources.

http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/bc10540_.htm

Is that still the *same* bar file, then?
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Tue Nov 11, 2014 6:59 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

That's moved the changes at deploy time from the bar file to the broker. It still involves someone being involved and doing something different between QA and PROD.

The only thing I want to be done differently between the QA deploy and the PROD deploy is:
Date/Time of deploy
Broker being deployed to
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Nov 11, 2014 7:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

mqsiapplybaroverrides doesn't have to involve someone either.

I understand your point about 'the same', and I'm sure you're trying to meet an audit requirement.

But basically, what you actually need to do is use a properties system of *some kind*. This can be UDPs, this can be a database table, this can be a flat file that sits on the broker, this can be global cache, this can be a web service that gets called, this can be nearly anything.

But UDPs are about the only thing that don't require custom coding in each and every flow.

Even aside from all of that, there are still a large number of things that don't require any change. DSNs, queue names, anything that is based on a configurable service, etc. These things all get resolved by the deployed environment to the correct location for that environment.
Back to top
View user's profile Send private message
nelson
PostPosted: Tue Nov 11, 2014 3:12 pm    Post subject: Reply with quote

Partisan

Joined: 02 Oct 2012
Posts: 313

smdavies99 wrote:
We use a table with one row for each flow. The flow reads it on startup and then it is cached in a shared variable. Thus any changes mean just a flow restart.


Very interesting discussion. How do I say a message flow to do something on startup?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Nov 11, 2014 8:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

PeterPotkay wrote:
That's moved the changes at deploy time from the bar file to the broker. It still involves someone being involved and doing something different between QA and PROD.

The only thing I want to be done differently between the QA deploy and the PROD deploy is:
Date/Time of deploy
Broker being deployed to


No it doesn't. You have the override properties for each environment stored in source control. Your deployment process is scripted and the apply bar override is part of the deployment process.

The only involvement is the setup of the properties in source control. It is flexible because when the developer changes the flow he has to adjust the override properties to match the new flow...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Tue Nov 11, 2014 11:20 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

nelson wrote:

Very interesting discussion. How do I say a message flow to do something on startup?


A Timer node will fire when the flow is started. Then with a bit of logic you can sunc the read. We also re-read the values every 24 hours.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 12, 2014 6:39 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

nelson wrote:
smdavies99 wrote:
We use a table with one row for each flow. The flow reads it on startup and then it is cached in a shared variable. Thus any changes mean just a flow restart.


Very interesting discussion. How do I say a message flow to do something on startup?

ESQL shared variables are not persistent across restarts.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Nov 12, 2014 6:45 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Hmm, ESQL can be used to query the Execution Group Label, which is the friendly name of the Execution Group.

http://www-01.ibm.com/support/knowledgecenter/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ak04897_.htm?lang=en

If I had a suffix appending to the end of the execution group, the ESQL could identify what EG its running in and thus automagically understand what environment it was in.

MY_EG_INT
MY_EG_QA
MY_EG_PROD
MY_EG_PERF
MY_EG_DEV


This would allow multiple logical environments to exist in parallel on the same Broker, as in create 2 execution groups on the same broker called MY_EG_INT and MY_EG_DEV.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Nov 12, 2014 9:01 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

mqjeff wrote:

ESQL shared variables are not persistent across restarts.


Quite correct.

That is why we use the Timer Node. This fires off a message when the flow is started/restarted. The ESQL (in an Atomic block) checks for the existence of one of the colums in the Row variable. If it is blank then it reads the data for that flow and only that flow (with no locking naturally)

The Atomic block makes sure that flows with multiple instances work properly.
This technique was first developed for Broker 6.0.0.0 circa 2006/7.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Nov 12, 2014 11:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PeterPotkay wrote:
If I had a suffix appending to the end of the execution group, the ESQL could identify what EG its running in and thus automagically understand what environment it was in.


And if I had wheels, I'd be a wagon.

Accepting that as has been previously commented you're trying to meet an audit requirement, it's unrealistic to consider a UDP a "change' to the deployed code. I'm also worried conceptually about this kind of "if I'm here I must do this" being in code rather than a UDP.

Consider this: you have logic that checks for transactions over the last 30 days in Prod but (to help with test data) only 10 days in QA and 1 day in test. By whatever mechanism, you determine where you are and apply the correct limit. The business then says 90 days not 30 days - you need a code change! If the number of days was a UDP, it's just a redeploy.

Also if a UDP changes the code, where do you stand on promotable properties?
_________________
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 topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Where am I?
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.