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 » compare bar files

Post new topic  Reply to topic
 compare bar files « View previous topic :: View next topic » 
Author Message
paustin_ours
PostPosted: Thu Apr 23, 2015 3:51 am    Post subject: compare bar files Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

here is what i am trying to do. When we do a release we create a bunch of bar files and deploy. Now next time we make a change to only one flow, we only deploy the changed flow. each flow is its own bar, so we deploy only the changed bar file. But we build all the bar files again just to be consistent with the version label from source control.

Now when we rebuild all the bars, i want to compare and make sure that only the changed bar is different and rest of the bars are same as the build done before since nothing has changed code wise. I know there will be date and other stuff that is going to be different. Is there a way to tell that the code is unaltered?

we dont add source inside bars, we use .cmf files.You think maybe we can compare the size of the files inside the bars?

pleas share your thoughts. thanks.
Back to top
View user's profile Send private message Yahoo Messenger
smdavies99
PostPosted: Thu Apr 23, 2015 4:09 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.

The size of the files inside the .Bar file could be identical but the contents could be different.
Probably better to compare something like the MD5SUM if you want to get down to that level.

But isn't this exactly what your source control system will tell you?
_________________
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
paustin_ours
PostPosted: Thu Apr 23, 2015 5:00 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

we don't store bar file(s) in source control. only source code. We store bar files on the individual server. So when a next set of bars are generated we only want to deploy the changed bar(changed source bar file) the others we want to store on the server and we want to make sure the rest of the bar files are the same as the ones generates on the last iteration by comparing the contents.

I don't know what MD5SUM is, i will look into it.
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Thu Apr 23, 2015 5:07 am    Post subject: Reply with quote

Grand High Poobah

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

MD5 check sum...

If you truly want to only change 1 file, you should copy the files from the last deploy and overwrite the barfile that was changed...

Anything else is not guaranteed to be the same. Think about, if someone missed running mqsiapplybaroverride, or the override parameters have changed, since, in anticipation of the next deploy 2 weeks down the road ?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Thu Apr 23, 2015 5:10 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.

There is a case for saving the .BAR files[1] (with the sources included) in your Source control system.
The bar file then is an automatic baselevel for that deployment.

We version the barfile file names as well. This way we can revert to any previous version just by extracting the bar file from source control and deploying it.

[1] I'm strictly old school here. anything that gets build and used should be stored in Source control. Sure there are merits for continuios integration but the old codger in me prefers surity of release over daily or hourly builds.
_________________
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
paustin_ours
PostPosted: Thu Apr 23, 2015 5:35 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

Quote:
If you truly want to only change 1 file, you should copy the files from the last deploy and overwrite the barfile that was changed...


we thought of copying over everything and only changing the one that had the source code changes. We have a lot of common components. Sometimes when we think that only one flow changed, it may be the case a change was done to another flow without us knowing or in the scenario when some code change to another flow was introduced by mistake.

if we copy stuff and deploy. We assume everything is fine. If we want to trace back an unwanted accidental change, it becomes difficult to figure out in which release it was introduced. I hope i am making sense.
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Thu Apr 23, 2015 5:48 am    Post subject: Reply with quote

Grand High Poobah

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

I would suggest you keep track (may be a db) of the releases and their content. So if a particular flow has a strange behavior, you can not only go back to the last release of that flow but also have a look at all the releases in between and see if a common component was deployed with another release that might affect the flow with the strange behavior.

There may be no easy solution. The fix might have to be a new release that makes the common lib involved compatible again...

Easier when you deal with applications as there is the additional level of isolation...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
paustin_ours
PostPosted: Thu Apr 23, 2015 7:22 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

I notice that the .cmf file size inside the bar file changes even when i add a single character. I guess this is good enough. I am convincing myself that what are the chances of something changing and the byte count is exactly the same as before - remote.
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Thu Apr 23, 2015 7:32 am    Post subject: Reply with quote

Grand High Poobah

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

paustin_ours wrote:
I notice that the .cmf file size inside the bar file changes even when i add a single character. I guess this is good enough. I am convincing myself that what are the chances of something changing and the byte count is exactly the same as before - remote.

Don't add a character, change a character in ESQL for instance.
Instead of using variable1 use variable2 and already the flow will behave differently. Same number of characters...

If you want to check equality for a cmf file you need to check a binary equality, byte by byte... and don't forget the broker.xml file...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
paustin_ours
PostPosted: Thu Apr 23, 2015 8:00 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

Quote:
don't forget the broker.xml file...


broker.xml doesnt help. It seems to be the same size even after changes to the code.

I see your point about changing a variable1 to variable4. The size of .cmf is the same. But it shows the difference when i do a hex compare. So i guess i could do a hex compare of .cmf file
Back to top
View user's profile Send private message Yahoo Messenger
mqjeff
PostPosted: Thu Apr 23, 2015 8:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can't rely on the .cmf file being there, particularly in newer versions of Broker.

If you can identify that a specific flow has changed, it's not clear why you should build all bar files.

You should also verify that redeploying a bar file with the same contents actually causes any issues in the runtime...
Back to top
View user's profile Send private message
paustin_ours
PostPosted: Thu Apr 23, 2015 9:32 am    Post subject: Reply with quote

Yatiri

Joined: 19 May 2004
Posts: 667
Location: columbus,oh

Quote:
You can't rely on the .cmf file being there, particularly in newer versions of Broker.


only reason is to be consistent with the baseline of our source control tool.

everytime we take a baseline, we get a slice of all the code and we create a folder with bars generated from that code.

now when we change one flow and create a new slice. We can create just that bar file and copy the rest from earlier but what if there is accidentally something changed in tthis code slice. I need to know so that why we want to build again.
Back to top
View user's profile Send private message Yahoo Messenger
t603
PostPosted: Fri Apr 24, 2015 4:24 am    Post subject: Re: compare bar files Reply with quote

Voyager

Joined: 16 Oct 2012
Posts: 88
Location: Prague, the Czech Republic, Europe

paustin_ours wrote:
Now when we rebuild all the bars, i want to compare and make sure that only the changed bar is different and rest of the bars are same as the build done before since nothing has changed code wise.


...Because BAR is ZIP, You can write a batch script, which unzip all old and new BARs to theirs folders under old an new top level folder. And then it is job for some XML DIFF tool (I am using "oXygen Diff Directories" and "oXygen Diff Files") to identify the changes. More readable results could be achieved when CMF = XML will have been pretty-printed before diff.
Back to top
View user's profile Send private message
t603
PostPosted: Fri Apr 24, 2015 4:38 am    Post subject: Reply with quote

Voyager

Joined: 16 Oct 2012
Posts: 88
Location: Prague, the Czech Republic, Europe

And if You upgrade Toolkit, then firstly build old bars without changes in new Toolkit, than apply changes and build new bars. This should avoid changes due to Toolkit upgrade.
I suppose, that building bars in Toolkit is deterministic - building the same sources (msgflow, esql) anytime using the same version of Toolkit should result in the same cmf.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Apr 24, 2015 5:14 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.

paustin_ours wrote:
Quote:
don't forget the broker.xml file...


broker.xml doesnt help. It seems to be the same size even after changes to the code.

I see your point about changing a variable1 to variable4. The size of .cmf is the same. But it shows the difference when i do a hex compare. So i guess i could do a hex compare of .cmf file


MD5SUM would have done that for you!
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » compare bar files
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.