# tibemsMsg_SetExpiration

Function

## Purpose

Set the expiration header of a message.

## C Declaration

    tibems_status tibemsMsg_SetExpiration(
        tibemsMsg message,
        tibems_long value );

## COBOL Call

    CALL "tibemsMsg_SetExpiration"
         USING BY VALUE message,
               BY REFERENCE value,
               RETURNING tibems-status
    END-CALL.

Note: `message` has usage pointer.

## Parameters

Parameter | Description
--- | ---
`message` | Set the expiration of this message.
`value` | Set the expiration to this value.

## Remarks

Sending calls set the expiration header automatically. The JMS specification defines this call for symmetry.

Sending calls record the expiration time (in milliseconds) of the message in this field:

- If the time-to-live is non-zero, the expiration is the sum of that time-to-live and the sending client’s current time (GMT).
- If the time-to-live is zero, then expiration is also zero—indicating that the message never expires.

The server discards a message when its expiration time has passed. However, the JMS specification does not guarantee that clients do not receive expired messages.

## See Also

`tibemsMsg_GetExpiration`

`tibemsMsgProducer_GetTimeToLive`

`tibemsMsgProducer_SetTimeToLive`

Copyright © Cloud Software Group, Inc. All rights reserved.