|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Inherit IBM.WMQ.[WMQAX].MQMessage in .Net |
« View previous topic :: View next topic » |
Author |
Message
|
ewilliams |
Posted: Tue Jun 07, 2005 12:01 pm Post subject: Inherit IBM.WMQ.[WMQAX].MQMessage in .Net |
|
|
 Apprentice
Joined: 27 Nov 2002 Posts: 30 Location: Portland
|
Is it possible to Inherit the MQMessage class and acutally us it? I have tried both the WMQ and WMQAX (which inherits from the WMQ one) and can not seem to use the writestring method.
Is anyone else doing this? If not, could a .Net WMQ developer out there give it a shot and verify or not the issue I am having.
I've tried on both WMQ 5.3 CSD 09 and WMQ 6.0. WMQ 5.3 just doesn't do anything and WMQ 6.0 will throw an IO.EndOfStreamException.
Code: |
Imports IBM.WMQAX
Imports IBM.WMQ.MQC
Module Module1
Sub Main()
Dim mqMsg As MQUtil = New MQUtil
With mqMsg
.Format = MQFMT_STRING
.PutApplicationType = MQAT_WINDOWS_NT
.CharacterSet = MQCCSI_Q_MGR
.Encoding = MQENC_NATIVE
.Priority = MQPRI_PRIORITY_AS_Q_DEF
.Persistence = MQPER_PERSISTENCE_AS_Q_DEF
.WriteString("FOOBAR")
End With
End Sub
End Module
Public Class MQUtil
Inherits IBM.WMQAX.MQMessage
End Class |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 07, 2005 12:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you subclass the MQ message you will need to remember to extract it when you process your MQputs. Same thing.. the MQget will not return an instance of your wrapper but an instance of the original. It will be up to you to map it.....
Enjoy  |
|
Back to top |
|
 |
ewilliams |
Posted: Tue Jun 07, 2005 10:41 pm Post subject: |
|
|
 Apprentice
Joined: 27 Nov 2002 Posts: 30 Location: Portland
|
That is sort of what I have now and was hoping to leverage some inheritance to cut down on the yuck factor in my class.
So what design would make a good .Net Class for an application?
In our shop we are using all Xml/Flat File data in our MQS messages so string functions are all we really need at this time. The usual Put Message, Browse Message and Remove Message but there is a need for get data from the header as well.
Any Thoughts/Suggestions? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 08, 2005 3:18 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's only so much of the MQ API that it is really feasible to abstract out rom an application. The difficulties come in because each abstraction tries to set a "default behavior" - and that is usually not sufficient for all business cases. So then you have to write more abstractions, or expose more of the MQ API, to allow programmers the ability to do the things they need to do.
In any case, I would use a wrapper pattern rather than a direct inheritance. _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|