timespec

Description

Message options and property values that accept a time interval using the timespec function accept the following syntax as a time specification for both MQ and JMS.

Syntax

'timeout=timespec'
	timespec ::= integer_number [ timespec_units ]
		timespec_units ::= { dd | hh | mi | ss | ms }

Parameters

dd

is days.

hh

is hours.

mi

is minutes.

ss

is seconds.

ms

is milliseconds.

timespec_units

is milliseconds. If you do not provide timespec_units, the default is milliseconds.

Examples

Example 1

Shows the time specification for 100 days:

-- timeout specified as 100 days
select msgrecv('ibm_mq:channel2/tcp/host2(5678)?'
    + 'qmgr=QM2,remote_qmgr=QM3,queue=QM3.Q'
    option 'timeout=100dd')

Example 2

Shows the time specification for 300 minutes:

-- timeout specified as 300 minutes
select msgrecv('ibm_mq:channel1/tcp/host1(5678)?'
    + 'qmgr=QM1,queue=SYSTEM.DEFAULT.LOCAL.QUEUE'
    option 'timeout=300mi')

Example 3

Shows the time specification for 1,024 milliseconds:

-- timeout specified as 1,024 milliseconds
select msgrecv(
    'ibm_mq:channel2/tcp/host2(5678)?'
    + 'qmgr=QM2,queue=SYSTEM.DEFAULT.LOCAL.QUEUE'
    option 'timeout=1024ms')

Example 4

(MQ) shows the time specification for 30 seconds:

-- timeout specified as 30 seconds
select msgrecv(
    'ibm_mq:channel1/tcp/host1(5678)?qmgr=QM1,queue=DEFAULT.QUEUE'
    option 'timespec=30ss')

Example 5

(JMS) shows the time specification for 30 minutes:

-- timeout specified as 30 minutes
select msgrecv(
    'tibco)_jms:tcp://localhost:7222?queue=queue.sample'
    option 'timeout=30mi')

See also

msgconsume, msgpublish, msgrecv, msgsend