Professional Documents
Culture Documents
Message Staging and Logging Options in Advanced Adapter Engine of PI - PO 7.3x - 7.4 - SAP Blogs PDF
Message Staging and Logging Options in Advanced Adapter Engine of PI - PO 7.3x - 7.4 - SAP Blogs PDF
4 | SAP Blogs
Products
Products Industries
Industries Services and Support
Services Support Training
Training Community
Community Developer
Developer
Partner
Partner About
About
Ask a Question Write a Blog Post Login
Vadim Klimov
November 6, 2012 8 minute read
Intro
One of features that were available in ABAP stack of PI 7.1x systems and that its Java stack was lacking is
customizable behavior of message persistence for various processing steps. Transition towards Java-only
processing in PI brought special attention to this topic due to major requirements focusing on more precise
monitoring of messages processed in Advanced Adapter Engine. One of very common use cases is the
requirement to check payload of the processed message before and after mapping execution (for example, in
order to identify correctness of the mapping execution for the particular message executed at runtime). As a
result, several signi cant and very useful enhancements in this area – namely, customizable message staging
and logging in Advanced Adapter Engine – were provided in PI 7.3x and extended in PI 7.31.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 1/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In this blog, I would like to summarize various message staging and logging options that are available in
Advanced Adapter Engine of PI 7.3x.
Overview
Following message staging and logging options are available in Advanced Adapter Engine of PI 7.3x:
Global staging/logging;
Scenario-speci c staging/logging using advanced settings of Integrated Con guration;
Scenario-speci c logging using adapter module in communication channel.
In PI 7.30, message staging customization is only possible globally for the entire Advanced Adapter Engine –
meaning that all scenarios running in the corresponding Advanced Adapter Engine are a ected by respective
staging con guration. Customizable global message logging and scenario-speci c staging/logging options are
not available in PI 7.30 yet.
In PI 7.31, customizable global logging (originally for synchronous messages) mechanism as well as scenario-
speci c staging and logging options were introduced making it possible to customize staging and logging of
messages in Advanced Adapter Engine di erently for speci c scenarios using advanced settings of Integrated
Con guration or a dedicated adapter module con gured in the respective communication channel.
In SP04 for PI 7.31, functionality of message logging is extended making it possible to use logging of
asynchronous messages.
Before proceeding with discussion of various staging and logging options, let’s rstly highlight major
di erences between these two mechanisms of the message persistence in Advanced Adapter Engine.
Purpose of message staging is persistence of an asynchronous message at a particular runtime processing step
(stage) for later editing/restart of the message from the persisted version as well as for displaying persisted
(staged) message.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 2/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Message logging is a more lightweight mechanism in comparison to message staging since there is less
information persisted during logging (only information required for message displaying) than during staging (all
information necessary for message displaying and restarting) as well as because during staging the persisted
message is put to the queue and retrieved from it for processing steps where staging applies. Thus, in case of
pure monitoring purposes, staging will bring more overhead to message processing, so logging is
recommended in this case.
Redundant staging and logging con gured for several (many) processing steps should be avoided since it
brings negative impact to message processing time in Advanced Adapter Engine as well as additional load on
database resulting in increased execution time of the scenario in PI and increased database growth rate.
Global staging/logging
Message staging and logging behavior is con gured adjusting corresponding properties of the J2EE service XPI
Adapter: XI:
For both mentioned properties, value syntax is composed by specifying processing step(s) and staging/logging
mode (condition) for each of speci ed processing step. If messages should be staged/logged at several
processing steps, respective step/mode pairs are delimited with comma ( , ).
Possible processing steps and modes that are relevant for staging are provided in tables below:
Processing Description
Step
BI After sender adapter processing, but before inbound schema validation
VI Before scenario look-up step (check if scenario is local Advanced Adapter Engine based or
dual-stack based involving Integration Engine)
MS Before mapping step
AM After mapping step, but before outbound schema validation
VO After outbound schema validation
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 3/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Mode Description
0 MODE_NO_STORE: No message persistence (staging)
1 MODE_STORE_ON_ERROR: Message is persisted only if its next processing step (stage)
throws an exception
2 MODE_STORE_AND_CONTINUE: Message is persisted and processing is continued with the
next step. If its next processing step throws an exception, the processor reschedules the
message from this storage and returns
Note: the mode is deprecated in PI 7.31 due to performance ine ciency during message
persistence
Mode values that are relevant for logging are derived from ‘basic’ 4-bit binary values by summarization of
respective ‘basic’ binary values and its further conversion to a decimal value. Relevant ‘basic’ values are
enumerated in the table below:
Binary Description
Value
0000 No logging
0001 Asynchronous messages are logged
0010 Synchronous messages are logged
0100 Onlу еrrοr mеѕѕаgеѕ аrе lοggеd
1000 Logging with cοntеnt hіdіng (payload is hidden)
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 4/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In this example, asynchronous messages are persisted (staged) in two versions – before mapping and after
mapping.
In Message Monitor, the persisted versions of the message can be observed (highligted on the screenshot
below):
Please also note that during staging, the message was put into the queue and retrieved it multiple times
(corresponding to amount of processing steps for which staging was con gured and should be conducted for
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 5/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
the processed message). This can be noticed when examining audit log of the message:
Similarly, sample custom con guration of global message logging is provided below:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 6/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In this example, asynchronous messages are persisted (logged) in two versions, at the same processing steps
as in the global staging example – before mapping and after mapping.
In Message Monitor, the persisted versions of the message can be observed (highligted on the screenshot
below):
In logging, there is no multiple operations of queue write (put) / read (retrieve) due to di erence in nature of the
logging mechanism in comparison to the staging mechanism:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 7/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Absence of additional queue write/read operations results in less overhead caused by logging than by staging –
the e ect that was already mentioned earlier in this blog.
Valid processing steps that can be chosen for staging and logging using advanced settings of Integrated
Con guration are the same as those applicable for global staging and logging con guration and described
earlier.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 8/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Sample con guration of combined options of staging and logging of Integrated Con guration is provided below:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 9/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In this example, messages (including their payloads) are persisted (staged) right after sender adapter
processing and are further persisted (logged) before mapping and after mapping.
In Message Monitor, the persisted (both staged and logged) versions of the message can be observed
(highligted on the screenshot below):
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 10/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Adapter module parameters and their valid values are enumerated in the table below:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 11/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
log.location Optional parameter that Name of the processing step within the adapter module
speci es processing step within processing sequence. If not speci ed, location default is
the adapter module processing used.
sequence where the message
should be logged
Sample con guration of the adapter module processing sequence of the communication channel that utilizes
the described adapter module is provided below:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 12/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In this example, asynchronous messages (including their payloads) that are processed by the receiver
communication channel’s SOAP adapter bean are persisted (logged).
Below is an extract of the audit log of the processed message were log entries re ecting execution of
MessageLoggerBean are highlighted – as seen, logging mode (controlled by log condition adapter module
parameter) is indicated:
In Message Monitor, the persisted version of the message can be observed, version of the message is controlled
by log location adapter module parameter (highligted on the screenshot below):
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 13/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Outro
Described staging and logging options can be employed in combination making staging and logging in
Advanced Adapter Engine even more exible.
For example, the below persisted versions of the processed message are outcome of joint usage of:
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 14/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
References
There are also other very nice materials on SCN that cover message staging and logging functionality available
in Advanced Adapter Engine of PI 7.3x – namely, it is highly recommended to go through following blogs to get
additional information on the topic:
PI/XI: PI 7.3 message version persistence for ICO integration ows – teaser, the blog written by Michal
Krawczyk: http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/10/18/pixi-pi-73-message-
version-persistence-for-ico-integration- ows–teaser
Scenario speci c message staging and logging in PI 7.31 AAE, the blog written by Nageshwar Reddy:
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/07/26/scenario-speci c-message-
staging-and-logging-in-pi-731
Message Versioning in the Advance Adapter Engine of PI 7.30, the blog written by William Li:
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/01/03/message-versioning-in-the-
advance-adapter-engine-of-pi-730
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 15/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Alert Moderator
Assigned tags
SAP Process Integration | advanced adapter engine | message logging | message staging |
Related Questions
24 Comments
Former Member
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 16/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
We are on PI 7.30 I can only see xiadapter.stage.conf in NWA and not the log property.
Many Thanks,
Sudharshan N A
Like (0)
Customizable logging isn’t possible in 7.3. In 7.3, only customizable global staging is available, global
customizable logging was introduced in PI 7.31. Thank you for this comment – I updated the blog with this
remark so that now it shouldn’t be confusing. Strictly speaking, customizable message persistence was
introduced in PI 7.3, but many signi cant improvements and nice features in this area were actually
implemented in PI 7.31.
Regards,
Vadim
Like (0)
Former Member
Good blog!
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 17/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
com.sap.engine.interfaces.messaging.api.exception.MessagingException:
com.sap.aii.af.sdk.xi.mo.xmb.DynamicCon guration.get(java.lang.String,
We are setup your log module in our adapter, but we don’t see the error message.
By the way check your picture, same are not display correct..
Regards,
Stefan
Like (0)
Thank you for pointing to the issue with pictures – I re-published the blog and now they should be back again.
As for the error you get… MessageLoggerBean is intended to log the version of the message for the particular
step (module) executed in the adapter module processing sequence – thus, if some error happened after
logged version of the message, this will not be caught by the logger module. Instead of it, you can use XPI
Inspector tool and use communication channel based inspection to collect details of the faced error – namely,
full callstack that caused this error and also error details and context. For the error itself, I would propose you
to create a thread on SCN for it so that we (and other SCN community members) could try to sort it out and
help you in solving the problem.
Regards,
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 18/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Vadim
Like (0)
Nageshwar Reddy
I also had a blog written on staging and logging (PI 731): Here is the link
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/07/26/scenario-speci c-message-
staging-and-logging-in-pi-731
Like (0)
This is surely a fair comment, thank you. I updated the blog with references and included links to SCN
materials on message logging/staging in AAE 7.3x topic.
Regards,
Vadim
Like (0)
Former Member
In the case of multiple Receivers or multiple Interfaces after interface determination, the MS stage will always get staged for each
new message id, regardless of global or speci c settings.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 19/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
In the case of single receiver and single target interface it works as expected.
But when conditions match for multiple receivers or multiple interfaces, the message gets staged at MS for
each split message.
Jonathan
Like (0)
Saurabh Kumbhare
Like (0)
Former Member
Like (0)
Pavan kumar
Cheers
Pavan
Like (0)
Former Member
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 20/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
January 14, 2015 at 5:04 pm
Thanks, excellent blog!
Is there any chance you know me where to nd the “Advanced Settings” Tab of the ICO in an IFlow?
I could edit the generated ICO, but editing generated objects is a very bad idea.
Like (0)
You don’t need to change generated iFlow properties in Integration Directory. In order to access iFlow-speci c
logging and staging parameterization, in NWDS, please open the corresponding iFlow, go to view ‘Properties’
and then to tab ‘Runtime Con guration’:
If you don’t see the the view ‘Properties’ in the SAP Process Integration Designer perspective, please go to
Window > Show View > Other… and select General > Properties there.
If Properties view looks di erent than the one provided on the screenshot above, please ensure that you didn’t
select any of sub-objects used in the iFlow (like business component, communication channel, mapping, etc.),
but the iFlow object is selected (e.g. click on empty area in canvas of the iFlow representation in Model
Con gurator).
Regards,
Vadim
Like (0)
Former Member
you were right, the “Properties” view was not active. Displaying it solved the problem.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 21/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Thank you!
Regards
Elias
Like (0)
Former Member
Like (0)
Like (0)
Synchronous messages. Synchronous messages are not persisted in database and are only stored in-memory of the Message
Store – here total amount of stored messages matters (only last X messages are stored). Amount of synchronous messages that
are kept in Message Store is regulated using property messaging.syncMessageRemover.messageCount of J2EE service XPI
Service: Messaging System (com.sap.aii.af.ms.svc). Each given period of time (regulated by
propertymessaging.syncMessageRemover.checkInterval (in minutes) of the same J2EE service), amount of syncronous
messages kept in Message Store is counted and corresponding messages are cleaned out of it by the respective thread (so,
speaking di erently, this property speci es a sleep time for this thread). Please note here that in the time period between
neighbouring checks, there can be a case when amount of synchronous messages is more
thanmessaging.syncMessageRemover.messageCount: e.g. in case of high load or large value
ofmessaging.syncMessageRemover.checkInterval.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 22/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Like (0)
Martin Babayan
With 7.31 SP12 (7.40 SP07) con guration of individual/scenario-speci c archiving & deletion retention periods
feature is available. 1960448 – Con gure message retention period per interface
Like (0)
S Kumar
Like (0)
Former Member
I just tested the Module MessageLoggerBean in one of our communication channels (SOAP Adapter, Transport
Protocol HTTP Axis).
It works ne when I put it at the beginning of the module order and I see the entry in the message editor
versions.
But when I put the MessagerLoggerBean after the AF_Adapters/axis/HandlerBean (after module key wssec or
trp, were the logon Information for the called web service is set) the additional logging entry is not being
displayed in the message editor anymore. The message protocol says that the LoggerBean is processed.
Best regards,
Stefan
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 23/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Like (0)
Hi Stefan,
Generally speaking, MessageLoggerBean does not depend on speci c adapter modules before/after which it
is called. I would suggest to perform a trace of the a ected Axis communication channel (for example, using
XPI Inspector) and get more details regarding execution of MessageLoggerBean. In the trace, please pay
special attention to entries corresponding to invocation of the method MessageLoggerBean.performLogging()
since actual logging logic is called (or not called) from there and the method writes important trace entries
indicating if message logging takes place and if not, then what the reason for this is.
Regards,
Vadim
Like (0)
Former Member
Like (0)
Former Member
Like (0)
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 24/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
The entire message staging and logging functionality is based on usage of speci cally dsigned tables as a
persistence layer – hence, usage of alternative logging frameworks is not of much use here.
Generally speaking, application server Java comes with SAP proprietary implementation of the logger
framework (SAP Logging API). There are certain possibilities to customize its behaviour and utilize it in
conjunction with alternative log destinations – as a result, log records can be shipped not only to default log
and trace les, but to some other arbitrary targets (remote servers, messaging systems, databases, log
processing systems, etc.). It shall be noted that ful lment of such requirement will require custom
development. As an example for one of such use cases, you can have a look into the following blog.
In case you need to utilize alternative logging frameworks and their implementations, it is also possible, but
will again require custom development – you can nd examples of usage of alternative logging frameworks in
custom Java applications deployed to SAP application server Java, but that is not related to staging/logging
functionality described here.
Regards,
Vadim
Like (0)
Former Member
I am new to PI/PO,I want to keep synchronous message more longer.I think I can con gue this parameter,but it
didn’t work.What’s “active Message Logging”?
Thanks.
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 25/26
7/8/2019 Message Staging and Logging Options in Advanced Adapter Engine of PI/PO 7.3x/7.4 | SAP Blogs
Sitemap Newsletter
https://blogs.sap.com/2012/11/06/message-staging-and-logging-options-in-advanced-adapter-engine-of-pi-73x/ 26/26