|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
unable to set the time and date |
« View previous topic :: View next topic » |
Author |
Message
|
sayli.jadhav |
Posted: Sun Jun 25, 2023 10:45 pm Post subject: unable to set the time and date |
|
|
Newbie
Joined: 13 Jun 2023 Posts: 4
|
hi,
in my application we have added below code to make these attributes input/output type:
put_pmo = pymqi.pmo(Options=CMQC.MQPMO_SYNCPOINT)
if attrib_name in ['UserIdentifier', 'AccountingToken', 'ApplIdentityData','PutApplType', 'PutApplName', 'PutDate', 'PutTime', 'ApplOriginData']:
put_pmo['Options'] += CMQC.MQPMO_SET_ALL_CONTEXT
however after adding this if user sets only ApplIdentityData, remaining field in MQ manager such as putDate, PutTime,PutApplName etc is blank.
to avoid this if user sets this value( in our extension point where pymq library is not available )added below code :
today = date.today()
d2 = today.strftime("%B %d, %Y")
logger("d2:%s"%d2)
message_header_attributes_map['PutDate'] = bytes(d2.ljust(24),'utf-8')
it shows Date as Nov 25 ,35559 which seems invalid.
I have 2 questions:
1. Is there any way where if user sets only 1 field such ApplIdentityData and rest fields of the message should be set as default value.
2. How can user set today's date and time in extension point why it is showing Nov 25 ,35559 how to set the putDate and putTime value |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Jun 26, 2023 12:47 pm Post subject: Re: unable to set the time and date |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
sayli.jadhav wrote: |
1. Is there any way where if user sets only 1 field such ApplIdentityData and rest fields of the message should be set as default value. |
No. Regular applications should not be using MQPMO_SET_ALL_CONTEXT.
Have you read the IBM MQ Knowledge Center?
If you use Origin Context (MQOO_SET_ALL_CONTEXT & MQPMO_SET_ALL_CONTEXT) then your application is responsible for setting the following 8 MQMD fields:
- PutApplType
- PutApplName
- PutDate
- PutTime
- ApplOriginData
- UserIdentifier
- AccountingToken
- ApplIdentityData
If you use Identity Context (MQOO_SET_IDENTITY_CONTEXT & MQPMO_SET_IDENTITY_CONTEXT): then your application is responsible for setting the following 3 MQMD fields:
- UserIdentifier
- AccountingToken
- ApplIdentityData
sayli.jadhav wrote: |
2. How can user set today's date and time in extension point why it is showing Nov 25 ,35559 how to set the putDate and putTime value |
PutDate and PutTime are character fields of length 8.
Code: |
MQCHAR8 PutDate; /* Date when message was put */
MQCHAR8 PutTime; /* Time when message was put */ |
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
hughson |
Posted: Tue Jun 27, 2023 3:39 am Post subject: Re: unable to set the time and date |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
RogerLacroix wrote: |
sayli.jadhav wrote: |
2. How can user set today's date and time in extension point why it is showing Nov 25 ,35559 how to set the putDate and putTime value |
PutDate and PutTime are character fields of length 8.
Code: |
MQCHAR8 PutDate; /* Date when message was put */
MQCHAR8 PutTime; /* Time when message was put */ |
Regards,
Roger Lacroix
Capitalware Inc. |
Just to finish that thought.
PutDate and PutTime are character fields of length 8 with the following format.
PutDate:
The format used for the date when this field is generated by the queue manager is:
YYYYMMDD
PutTime:
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)
T
tenths of a second (0 through 9)
H
hundredths of a second (0 through 9)
For more details see PutDate and PutTime in IBM Docs.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Jun 27, 2023 4:25 pm Post subject: Re: unable to set the time and date |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
sayli.jadhav wrote: |
hi,
in my application we have added below code to make these attributes input/output type:
put_pmo = pymqi.pmo(Options=CMQC.MQPMO_SYNCPOINT)
if attrib_name in ['UserIdentifier', 'AccountingToken', 'ApplIdentityData','PutApplType', 'PutApplName', 'PutDate', 'PutTime', 'ApplOriginData']:
put_pmo['Options'] += CMQC.MQPMO_SET_ALL_CONTEXT
|
Hi sayli.jadhav,
What are the valid cases for users needing to set these attributes? The MQMD context attributes are important for identity, security, traceability and support. Apps should not change any of them from the default values set by MQ, unless they have a very very good reason to do so. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Jun 28, 2023 4:42 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
More importantly, will your use case (for faking MQMD date/time) pass internal and external audit? IMHO, not likely. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Jun 28, 2023 4:21 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
bruce2359 wrote: |
More importantly, will your use case (for faking MQMD date/time) pass internal and external audit? IMHO, not likely. |
It also needs to be set to UTC date/time, not local date/time. _________________ Glenn |
|
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
|
|
|
|