Reformat messages: exitmqc.c

Restriction: This exit is only available in JMS mode or in MQSeries mode and in C language.

Characteristics

This exit is used in two ways:

  • In input mode: immediately after receiving the message, and before performing any processing associated with the Input-Events to:
  • Add the message technical header expected by the session
    • Decrypt, decompress and restructure the data
    • If necessary, assign the identifiers associated with the Input-Events
  • In output mode: immediately before sending messages, and after performing any processing associated with the Output-Events to:
    • Encrypt, compress and restructure the data
    • Delete the message technical header generated by the session

It is equivalent to the Input and Output-Event restructuring exits provided for File mode sessions.

Operating principle

The exit is called:

  • In input mode for each message read in the queue
  • In output mode for each message prepared, just before it is written

Specific features

If an anomaly is detected in this exit, the session is closed.

The data in the rejected Input-Event is the reformatted data. Consequently, when programming this exit, you must handle the case in which Input-Events that have already been reformatted are being reprocessed.

Exchanged data

Three entry points are available for this function:

  • Initialization:Initializes the module and is called at the start of the session
  • Processing: The product code passed to the module in the input area indicates the type of data to process, and in which “case” instruction you must declare the associated processing.
    This entry point is common to all data
  • Close: Closes the module and is called at the end of the session

INPUT data

Name in C Characteristics / Length Use

nTraitement

int / 1

Entry point code

szCodeEmetDest

Alphanumeric / 25

Sender code when nCodeProduit = IEvent

Output Code when nCodeProduit = OSegt or IEvent_Redirected

Otherwise, it is empty

nCodeProduit

int

Product code of the transmitted data (the descriptions associated with each product code are defined in the following table)

lLgMaxMessage

long

Maximum size allocated to the message buffers
(input and output)

sMessageIn

Alphanumeric

Data sent in the message

lLgMessageIn

long

Size of the message sent

pMessageCtx

 

Context of the message sent

OUTPUT data

Name in C Characteristics / Length Use

sMessageOut

Alphanumeric

Data in the reformatted message

lLgMessageOut

long

Size of the reformatted message

pMessageCtx

 

Context of the reformatted message

szLibelleErreur

Alphanumeric

Error message if the function fails

Return value

 

  • MQS_nNO_ERREUR: Reformatting OK
  • MQS_nERREUR_BLOQUANTE: Fatal error, the session is closed

Product codes

Product Code Product Description Product Segment Type

1

Input-Event to be transformed

MQS_nCRE

2

Data to print transformation details

MQS_nDETAIL_TRADUCTION

3

Input-event journal printout

MQS_nJOURNAL_CRE

4

Accounting journal printout

MQS_nJOURNAL_COMPTABLE

5

Data to print the transformation counters

MQS_nCOMPTEUR_TRADUCTION

6

Printout of counters for each Rule

MQS_nCOMPTEUR_REGLE

7

Detailed accounting aggregation printout

MQS_nAGREG_COMPTABLE

8

Data to print the operation counters

MQS_nCOMPTEUR_EXPLOITATION

9

Audit traces extracted from the processed Input-Events

MQS_nTRACE_CRE

10

Audit traces extracted from the generated Output-Events

MQS_nTRACE_ME

11

Data to print redirection details

MQS_nDETAIL_AIGUILLAGE_CRE

12

Input-Event in transformation anomaly

MQS_nCRE_ANOMALIE

13

Input-Events rejected by the transformation

MQS_nCRE_REJECTED

14

Modified Input-Events

MQS_nCRE_MODIFIED

15

Data to print transformation anomaly details

MQS_nDETAIL_ANOMALIE_REJET_CRE

16

Specific printout

MQS_nDETAIL_EDITION_SPECIFIQUE

17

Input-Events redirected by Processing-Context-Out

MQS_nCRE_AIGUILLE

18

Output-Events distributed by Processing-Context-Out

MQS_nME

 

Implementation

Description conventions

  Description

1.

The identifiers set in the communication area cannot be changed. If the values are changed, they are ignored during session execution

2.

By default, the return code is 0 (zero)

3.

By default, the output message is identical to the input message

4.

By default, the exit contains the code required to add and remove the message header expected by Rule Engine

5.

 If you want to close the session, you must set the error message field

6.

You can change all data associated with the message context, EXCEPT for the value of CorellId when group management is enabled
Changing this value has no impact, as its initial value is kept to detect the messages in the same group

7.

 The maximum size allocated to the message buffers (lLgMaxMessage) must not be exceeded when you build reformatted messages

You must always respectlLgMessageout   <   lLgMaxMessage

Parameter settings

The parameters are set directly by defining the exchange area in the script.jms file or in the script.mqs file.

FileAttente=MQS, , “Manager=Qmngr;File=FileName;Reformatting=Yes;Blockage=Yes;Buffer=number”

Module names

Implementation

Platform Directory Name Function name / C Program COBOL Program

Windows

%RDJ_EXEC%\exit

MQS_EXIT_Reformatting function

exitmqc.c
exitmqh.h header file

Does not exist

UNIX

$RDJ_EXEC/exit

MQS_EXIT_Reformatting function

exitmqc.c
exitmqh.h header file

Does not exist

MVS

&RDJEXEC..SRCLIB

MQS_EXIT_Reformatting function

EXITMQC
EXITMQH header file

Does not exist

 

Processing Type Entry Point

Open

MQS_nEXIT_INITIALISATION

Close

MQS_nEXIT_FERMETURE

Message processing

MQS_nEXIT_TRAITEMENT

Related Links