|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Problem In MQ MessageID |
« View previous topic :: View next topic » |
Author |
Message
|
atheek |
Posted: Tue Nov 18, 2008 5:30 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
fjb_saper wrote: |
So you mean to say that your qmgr is not under HA while the app using it is?
Your triggered app living under the qmgr could be under HA as well... |
Ok agree.
Agree with your comments of using non anonymous identifiers for messageId and CorrelationID as anti pattern. But is using java api within j2ee environment an anti pattern? What are the disadvantages for it? Especially for a case where an anonymous identifer needs to be set for message ID from a j2ee environment?
I could see a few disadvantages with using your solution:
1. Extra setup required for triggering. Very rarely you will see a MQ familiar project team developing j2ee solutions on a non WAS application server.
2. An extra layer added ( the queue between app server and java utility). Now think about performance and response times.
3. An extra point of failure ( the standlone java utility ) |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 18, 2008 9:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
atheek wrote: |
fjb_saper wrote: |
So you mean to say that your qmgr is not under HA while the app using it is?
Your triggered app living under the qmgr could be under HA as well... |
Ok agree.
Agree with your comments of using non anonymous identifiers for messageId and CorrelationID as anti pattern. But is using java api within j2ee environment an anti pattern? What are the disadvantages for it? Especially for a case where an anonymous identifer needs to be set for message ID from a j2ee environment?
I could see a few disadvantages with using your solution:
1. Extra setup required for triggering. Very rarely you will see a MQ familiar project team developing j2ee solutions on a non WAS application server.
2. An extra layer added ( the queue between app server and java utility). Now think about performance and response times.
3. An extra point of failure ( the standlone java utility ) |
How about dual connection pools (J2EE + java base)
Undetermined Transactionality bad mix with J2EE and MQ base
The extra set up for triggering is not that important.
Performance and run time can be mitigated by allowing a max number of instances (threads) for the app to be started .... This number could be configurable and passed either through a property/ini file or through the trigger Data.
Additional layer and extra point of failure... Yes... Does not happen often in my experience if the trigger is written correctly.
The question is really what kind of an SLA are we subjected to here?
If it is sparse but subsecond you might not want to go the triggered route. _________________ MQ & Broker admin |
|
Back to top |
|
 |
meetgaurav |
Posted: Tue Nov 18, 2008 9:25 am Post subject: |
|
|
Voyager
Joined: 08 Sep 2008 Posts: 94
|
msg.messageId = msgid.getBytes();
instaed of this I need to do
Code:
Code: |
public static byte[] toBinArray( String hexStr ){
byte bArray[] = new byte[hexStr.length()/2];
for(int i=0; i<(hexStr.length()/2); i++){
byte firstNibble = Byte.parseByte(hexStr.substring(2*i,2*i+1),16); // [x,y)
byte secondNibble = Byte.parseByte(hexStr.substring(2*i+1,2*i+2),16);
int finalByte = (secondNibble) | (firstNibble << 4 ); // bit-operations only with numbers, not bytes.
bArray[i] = (byte) finalByte;
}
return bArray;
}
|
|
|
Back to top |
|
 |
meetgaurav |
Posted: Tue Nov 18, 2008 10:12 pm Post subject: |
|
|
Voyager
Joined: 08 Sep 2008 Posts: 94
|
Thanks Atheek / FJB
Completed everything, The peformance is also good. No diff. b/w JMS and JAVA now(Performance wise). am just committing the qmgr in on message(). Also I converted the message id to byte[] using below method and then assigned the result to mesageid.
Code: |
public static byte[] toBinArray( String hexStr ){
byte bArray[] = new byte[hexStr.length()/2];
for(int i=0; i<(hexStr.length()/2); i++){
byte firstNibble = Byte.parseByte(hexStr.substring(2*i,2*i+1),16); // [x,y)
byte secondNibble = Byte.parseByte(hexStr.substring(2*i+1,2*i+2),16);
int finalByte = (secondNibble) | (firstNibble << 4 ); // bit-operations only with numbers, not bytes.
bArray[i] = (byte) finalByte;
}
return bArray;
}
|
Have to test the XA part alone. Then I have 1 more query on MDB.
If I didn't point out the minimum and maximum instances in the deployment descriptors. Then at wat time the MDB will create multiple instances.
EX: I have 2000000 messages in a Queue.
No, minimum and maximum instances are configured in my deployment descriptors. Whether it will process the messages using single thread or it will automatically create more threads. If so ?? at wat time it will create. |
|
Back to top |
|
 |
atheek |
Posted: Wed Nov 19, 2008 2:07 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
check oc4j documentation for the defaults...
If the jms provider delivers the message to mdb and all instances are currently in use and the number of current mdb instances is less than the maximum, then the app server will spawn a new mdb instance to the pool. |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|