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 » IBM MQ API Support » amqmdnet.dll(BUG?) vs MQAX - Setting the MQMD.PutDateTime

Post new topic  Reply to topic
 amqmdnet.dll(BUG?) vs MQAX - Setting the MQMD.PutDateTime « View previous topic :: View next topic » 
Author Message
ewilliams
PostPosted: Fri Nov 05, 2004 9:53 pm    Post subject: amqmdnet.dll(BUG?) vs MQAX - Setting the MQMD.PutDateTime Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

** Note this post is about the MQMD.PutDateTime being read-only with the amqmdnet.dll assembly and read-write in the MQAX ActiveX Component.

I am trying to get some control of the MQMD fields when putting a message to the queue. I can get to all of fields that I want to modify except the PutDateTime field, which in MQAX is a read-write field and in amqmdnet the assembly it is a read-only field per the object browser. Why?

The following VB.Net code shows a Invalid Date Time in Queue Browser MQ Explorer and while stepping through the code the PutDateTime property shows:
Code:
<error: an exception of type: {System.FormatException} occurred>   Date


This occurs on CSD07 and CSD08.

Any Ideas? This is one of the final hurdles in porting my code to .Net.
Any response is greatly appreciated!!
Thanks,
Eric

Here is the function:
Code:

Public Overridable Function PutMessage(ByVal MessageData As String) As Int32
    Dim mqQMgr As MQQueueManager               '* MQQueueManager instance
    Dim mqQueue As MQQueue                     '* MQQueue instance
    Dim mqMsg As MQMessage                     '* MQMessage instance
    Dim mqPutMsgOpts As MQPutMessageOptions    '* MQPutMessageOptions instance

    '* Try to create an MQQueueManager instance
    Try
      mqQMgr = New MQQueueManager(_QMgrName)
      mqQueue = mqQMgr.AccessQueue(_QueueName, MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING _
                                              + MQOO_SET_ALL_CONTEXT + MQPMO_PASS_IDENTITY_CONTEXT)
    Catch mqe As MQException
      Return (mqe.Reason)
    End Try

    Try
      'MQ Message Object
      mqMsg = New MQMessage
      With mqMsg
        .ApplicationIdData = "ApplIdData123456890ABCDEF1234568"
        .ApplicationOriginData = "1234"
        .Format = MQFMT_STRING
        .PutApplicationName = "Put Msg App"
        .PutApplicationType = MQAT_WINDOWS_NT
        .CharacterSet = CODESET_437
        .Encoding = MQENC_NATIVE
        .UserId = "HardCoded ID"
        .Priority = MQPRI_PRIORITY_AS_Q_DEF
        .Persistence = MQPER_PERSISTENCE_AS_Q_DEF
        .WriteString(MessageData)
      End With

      ' Put Message Options
      mqPutMsgOpts = New MQPutMessageOptions
      mqPutMsgOpts.Options = mqPutMsgOpts.Options _
                              + MQPMO_NEW_MSG_ID + MQPMO_NEW_CORREL_ID _
                              + MQPMO_SET_ALL_CONTEXT

      'Put Message to the Queue
      mqQueue.Put(mqMsg, mqPutMsgOpts)

      Return mqQueue.ReasonCode()

    Catch mqe As MQException
      Return (mqe.Reason)

    Finally
      ' Close Queue & Queue Manager
      mqQueue.Close()
      mqQMgr.Close()

      ' Cleam up objects,  no dispose objects available
      mqQMgr = Nothing
      mqQueue = Nothing
      mqMsg = Nothing
      mqPutMsgOpts = Nothing

    End Try

  End Function


Last edited by ewilliams on Mon Nov 08, 2004 7:30 am; edited 2 times in total
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 06, 2004 1:38 pm    Post subject: Reply with quote

Grand High Poobah

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

I understand that you get a system format exception.
If you are expecting your date to be in standard locale windows format that is reassuring and should be so.

Remember as well that your date is always in UTC time zone. So you will have to translate it to the local time zone to make it meaningfull to you.

Enjoy
Back to top
View user's profile Send private message Send e-mail
ewilliams
PostPosted: Sat Nov 06, 2004 11:52 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

fjb_saper wrote:
I understand that you get a system format exception.
If you are expecting your date to be in standard locale windows format that is reassuring and should be so.

Remember as well that your date is always in UTC time zone. So you will have to translate it to the local time zone to make it meaningfull to you.

Enjoy


I have updated my function (see first post) and am getting blanks for the Date and Time when running amqsbcg, any other ideas?

Code:

AMQSBCG0 - starts here
**********************
 
 MQOPEN - 'Q.TEST.IN'
 
 
 MQGET of message number 1
****Message descriptor****

  StrucId  : 'MD  '  Version : 2
  Report   : 0  MsgType : 8
  Expiry   : -1  Feedback : 0
  Encoding : 546  CodedCharSetId : 437
  Format : 'MQSTR   '
  Priority : 0  Persistence : 0
  MsgId : X'414D5120514D2E4D4F525249534F4E2E98D18D4120000801'
  CorrelId : X'414D5120514D2E4D4F525249534F4E2E98D18D4120000802'
  BackoutCount : 0
  ReplyToQ       : '                                                '
  ReplyToQMgr    : 'QM.MORRISON.DV                                  '
  ** Identity Context
  UserIdentifier : 'HardCoded ID'
  AccountingToken :
   X'0000000000000000000000000000000000000000000000000000000000000000'
  ApplIdentityData : 'ApplIdData123456890ABCDEF1234568'
  ** Origin Context
  PutApplType    : '11'
  PutApplName    : 'Put Msg App                 '
  PutDate  : '        '    PutTime  : '        '
  ApplOriginData : '1234'

  GroupId : X'000000000000000000000000000000000000000000000000'
  MsgSeqNumber   : '1'
  Offset         : '0'
  MsgFlags       : '0'
  OriginalLength : '-1'
 
****   Message      ****
 
 length - 16 bytes
 
00000000:  3C54 5465 7374 204D 6573 7361 6765 2F3E '<TTest Message/>'
 
 
 
 No more messages
 MQCLOSE
 MQDISC

Back to top
View user's profile Send private message
bob_buxton
PostPosted: Sun Nov 07, 2004 2:08 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

Since you have specified SET_ALL_CONTEXT you must set the mqmd putdate and puttime in GMT in character format

The format used for the date when this field is generated by the queue manager is:

YYYYMMDD

where the characters represent:

YYYY
year (four numeric digits)
MM
month of year (01 through 12)
DD
day of month (01 through 31)

The format used for the time when this field is generated by the queue manager is:

HHMMSSTH

where the characters represent (in order):

HH
hours (00 through 23)
MM
minutes (00 through 59)
SS
seconds (00 through 59; see note below)
T
tenths of a second (0 through 9)
H
hundredths of a second (0 through 9)
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
ewilliams
PostPosted: Sun Nov 07, 2004 9:40 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

bob_buxton wrote:
Since you have specified SET_ALL_CONTEXT you must set the mqmd putdate and puttime in GMT in character format


I totally agree with that the but the property is read-only and that is why I was also wondering if there was a bug in amqmdnet.

Per the Object Browser:
amqmdnet
Code:
Public ReadOnly Property PutDateTime() As Date
     Member of: IBM.WMQ.MQMessage

MQAX
Code:
Public Overridable Property PutDateTime() As Object
     Member of: MQAX200.MQMessage


Here is the data on the assembly:
Run-Time Version=v1.1.4322
Version=1.0.0.3
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Nov 08, 2004 3:10 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

It is readonly in the .net library - you would need to talk to IBM and get a requirement raised to get this property modifiable (assuming it makes sense for it to be writable as well!)....
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Mon Nov 08, 2004 3:39 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

I know nothing about MQAX but I agree that it doesn't make much sense for some but not all of the origin context fields to be settable.

I suggest modifying the title of this thread to make it clear that it relates to MQAX so that those that do know about it notice the thread.

You could also raise a problem with the IBM support centre.
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Nov 08, 2004 4:01 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

BTW This isnt MQAX but amqmdnet.dll, ie the .NET interface. MQAX came up just as a comparison
Back to top
View user's profile Send private message
bob_buxton
PostPosted: Mon Nov 08, 2004 5:54 am    Post subject: Reply with quote

Master

Joined: 23 Aug 2001
Posts: 266
Location: England

I support MQ on CICS and zOS - all of these other fancy interfaces are a mystery to me
_________________
Bob Buxton
Ex-Websphere MQ Development
Back to top
View user's profile Send private message
ewilliams
PostPosted: Tue Nov 16, 2004 8:27 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

Well here is IBM's Response to the issue.

Quote:
Hello Eric,

Right now at our current code level it appears that there is no way within our code to set the PUT date and time.
Below is the response of the Change Team to your last question.
.
Unfortunately the customer will have to find another way around this problem, as the current .NET interface does not support a writable putdatatime field. MQ doesn't guarantee that support for all features is possible from all languages, and although we try hard this is just something which needs to be done through the requirements process. Perhaps the requirement could request that any change gets back ported to 5.3, but you would still be looking at some time in the future.
Regards,
Jason
.
I have emailed you a Design Change Request form. Please let me know if you intend to submit the form or would just like the PMR closed.
Back to top
View user's profile Send private message
JasonE
PostPosted: Tue Nov 16, 2004 8:44 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Please do raise it as a DCR - it makes sense to do it, but its an external change hence the need for the requirement. I have already primed the development team, but changes are prioritized based on customer demand.

Jason
Back to top
View user's profile Send private message
wmq_guy
PostPosted: Thu Nov 18, 2004 3:38 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Oct 2004
Posts: 50

i'm a little confused by MQOO_SET_ALL_CONTEXT

what does this give you the abilty to exactly do?
Back to top
View user's profile Send private message
ewilliams
PostPosted: Thu Nov 18, 2004 5:07 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

Well we just have to wait and see if it becomes a reality. Here is what I got back from IBM after my submission of the request.
Quote:
Thank you for submitting an MQSeries Requirement.

We have reviewed your requirement and have the following
response:

Accepted- IBM agrees with the request and a solution is desirable and feasible.
IBM intends to provide a solution. However, IBM's plans may change, and no commitment is made that a solution will be provided.


This will be fixed in the next release of WMQ

Please quote reference number: R3302
All queries should be directed towards MQ Requirements.
Lotus Notes: MQ Requirements/UK/IBM.
Internet Mail: mqreq@uk.ibm.com.
Back to top
View user's profile Send private message
jayrowe
PostPosted: Wed Dec 29, 2004 11:07 am    Post subject: Make your own! Reply with quote

Newbie

Joined: 29 Dec 2004
Posts: 1

If the need is urgent, you could probably (fairly easily) make your own .NET library for MQ:


Get Lutz Roeder's .NET Reflector (http://www.aisto.com/roeder/dotnet/), and the Reflector.FileDisassembler addin from http://www.freewebs.com/csharp/Reflector/AddIns/.

Open amqmdnet.dll in .NET Reflector, dump the disassembly to files, add the appropriate set method, and recompile.
Back to top
View user's profile Send private message AIM Address
ewilliams
PostPosted: Fri Nov 04, 2005 9:14 am    Post subject: Reply with quote

Apprentice

Joined: 27 Nov 2002
Posts: 30
Location: Portland

Finally had a chance to get back to this issue and it has been fixed in WSMQ 6.0.
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 » IBM MQ API Support » amqmdnet.dll(BUG?) vs MQAX - Setting the MQMD.PutDateTime
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.