The Events page lists all events generated by the Pricefx server. For example, when a price is approved, ITEM_APPROVED_PGI event is generated.
Events are an important part in integration between Pricefx and external systems. The Pricefx server either sends (pushes) events to a specified URL (or email address) where IntegrationManager (IM) listens and then IM performs actions based on a specific implementation. Or IntegrationManager fetches (pulls) events from the server and then performs actions based on the specific implementation. Pricefx can also publish events to RabbitMQ. RabbitMQ is the channel used by the SAP BTP Plugin and by PlatformManager Workflow Orchestration. Since version 17.3, Pricefx also stores every event published to RabbitMQ in the event table described below.
In this section:
See also:
-
Complete list of event types at
-
IntegrationManager documentation on Events
Events Page
The Events page displays:
-
Name of the event, its creation time and the time of the last update.
-
Message (payload) of the event.
-
Number of retries left: the server attempts delivery up to 5 times (default).
-
HTTP response returned by the destination server.
-
Error message if returned by the destination server.
-
MQ Message: the message published to RabbitMQ. It contains the event type, a few header fields and the typedId of the changed object, not the full object.
-
MQ Retries Left: the RabbitMQ delivery state of the event. See MQ Retries Left Values below.
-
MQ Error Message: the last RabbitMQ delivery error, if any.
The partition in this screenshot is set up for Pull Events but there is no IntegrationManager to read the events, so they still have Retries Left set to 5. When you move your mouse over the message, its full content is shown.
MQ Retries Left Values
The MQ Retries Left column is available since version 17.3.
|
Value |
Meaning |
|---|---|
|
1 to 5 |
The event is not yet delivered to RabbitMQ. Pricefx retries it automatically. |
|
-1 |
RabbitMQ confirmed the delivery. |
|
0 |
Pricefx stopped trying to deliver the event. MQ Error Message shows the reason. |
|
Empty |
The event is not sent to RabbitMQ, or it was created while the legacy behavior was active. Pricefx does not retry these events. |
Retries Left and Response describe HTTP delivery only. For an event that is sent only to RabbitMQ, Retries Left is -1.
Resending Events to RabbitMQ
Since version 17.3, you can send selected events to RabbitMQ again. Use this, for example, when a consumer failed to process an event.
-
Go to Administration > Logs > Events.
-
Select one or more events.
-
Click Resend Event/s to MQ.
-
Click Confirm.
Pricefx sends the selected events to RabbitMQ again. A confirmation message shows how many events were planned for resending.
Pricefx skips these events:
-
Events without an MQ Message. They were never sent to RabbitMQ.
-
Events that Pricefx still retries automatically (MQ Retries Left is greater than 0).
Pricefx resends at most event.maxBatch events per request and skips the rest.
An event that was already delivered is delivered again. The consumer receives a duplicate, so it must deduplicate by eventId. Resend only the events the consumer failed to process.
To resend events from an integration, call the event.resend endpoint with the typedIds of the events. The endpoint requires the EVENTTASK_UPDATE permission. The General Admin, General Admin (without User Management), Support and Data Integration roles include it.
If the partition has no RabbitMQ target, the resend reports success but sends nothing (PFUN-36895).
Configuration
To have events generated, you need to configure two places: system partition and your own partition.
These events can also be configured in PlatformManager.
System Partition Configuration
Here it is defined which events are generated. By default, all event types are generated by Pricefx (when events generating is enabled). But, depending on the project, certain user actions can generate a lot of events (e.g., ITEM_APPROVED_PGI or ITEM_UPDATE_PPV) which you might not need.
To select which event types Pricefx generates for the partition, use the Event Bitmask option in the Event Configurator in PlatformManager. You need the Partition Admin - Events permission in PlatformManager.
The Event BitMask field in System Admin → Partition Admin is deprecated since version 16. Only the Pricefx Support team can access that screen.
Partition Configuration
Here you define how and where events are delivered. Two settings turn on event generation:
-
The Event URL field in Administration > Configuration > General Settings, for HTTP delivery.
-
The RabbitMQ target of the partition (Event to Kafka/MQ in the PlatformManager Event Configurator), for RabbitMQ delivery.
If at least one of them is set, Pricefx stores each event in the event table.
-
Event URL is an HTTP endpoint to which events from the current partition are published.
-
If it is filled in, events are generated.
-
If you want to use Pull Events or you want Pricefx to generate events without sending them anywhere, use any dummy value here, e.g., "http://dummy_url". In addition, select the Disable sending events through HTTP (PUSH) checkbox.
-
If you want to use Push Events, use the URL of an IntegrationManager endpoint (contact the Integrations team to get a correct URL). Also, make sure the Disable sending events through HTTP (PUSH) checkbox is not selected.
-
With the dummy-value configuration above (a dummy Event URL plus the Disable sending events through HTTP (PUSH) checkbox selected), events are recorded in the event table but never delivered over HTTP. The dummy value is detected by a substring check (the configured value contains the word
dummy), so the HTTP send is skipped, and the Disable checkbox stops the background processor from touching the records at all. The records therefore stay "unprocessed" (Retries Left = 5, Response = 0) and remain in the event table for the full unprocessed retention period (see Additional System Setting below). On a partition that uses this configuration and consumes events only through RabbitMQ, this is the normal cause of a large event table. -
Since version 17.3, you do not need a dummy Event URL to see RabbitMQ events on the Events page. Keep the dummy value only if you use Pull Events, or if you need the full object in the event message. The RabbitMQ message contains only the typedId of the object.
-
-
If it is blank, Pricefx does not deliver events over HTTP. If the partition has a RabbitMQ target, Pricefx still publishes events to RabbitMQ and stores them in the event table (since version 17.3). Before version 17.3, these events were not stored.
-
In addition, generated events can also be sent to an email address.
Additional System Setting
The events are deleted and disappear from the list after a specified time: successful events after 5 days, failed and unprocessed events after 100 days. The three states are defined as follows:
-
Successful events are those delivered with HTTP status 200 (or consumed by IntegrationManager), and also delivered to RabbitMQ if RabbitMQ applies. An event that is sent only to RabbitMQ is successful once RabbitMQ confirms it. Removed quickly (default 5 days,
event.retainEventsInDays.successful). -
Failed events are those delivered with an HTTP status other than 200, or whose RabbitMQ delivery ran out of retries (default 100 days,
event.retainEventsInDays.failed). An event counts as failed only when neither channel has retries left. -
Unprocessed events are those that still have retries left on either channel, including dummy-URL records and RabbitMQ events that Pricefx still retries. They are kept the longest (default 100 days,
event.retainEventsInDays.unprocessed). Lower this value if the table grows too large.
If necessary, you can change the default settings by adding the following elements to the /var/pricefx/static/<instance_config_file>.xml with the required values:
<event>
<retainEventsInDays>
<successful>5</successful>
<failed>100</failed>
<unprocessed>100</unprocessed>
</retainEventsInDays>
</event>
The values must not decrease: successful ≤ failed ≤ unprocessed. If they do, the purge job raises the lower values and logs a warning.
Working with Events
An event in Pricefx is often used to trigger an action, for example:
-
A Quote or Price List is exported to an external system immediately on approval.
-
The completion of an Analytics Data Load notifies IntegrationManager.
Typical Flow
The following example of a Price List export after approval illustrates how events are used:
-
Pricing manager creates a Price List and submits it for approval.
-
Approver approves the Price List.
-
Pricefx creates an event (record) and stores it in a table EventTask (type code: EVT).
-
If Push Events is required, it pushes a message with the event to IntegrationManager over an HTTP request.
-
The unsent messages (with Retries Left > 0) are sent regularly (by default every minute) to IntegrationManager. The response status code of that call is stored in the field Response. When IM replies with success (Status 200), Pricefx will set Retries Left to 0, so that it does not try to send it again.
-
-
If the partition has a RabbitMQ target, Pricefx publishes the event to RabbitMQ. See RabbitMQ Delivery and Retries.
-
-
IntegrationManager:
-
If Pull Events is required, it pulls a list of new events from the EventTask table via Pricefx REST API.
-
IM reads events regularly (by default every 60 seconds) and you can filter which events to read.
-
If the processing of the event is successful, IM will update Retries Left (set to 0) and Response in the EventTask table (via Pricefx REST API call).
-
-
Reads the records of the Price List from the PL/PLI tables (via Pricefx REST API).
-
Converts the PLI records as required by the external system (CSV, XML,…).
-
Sends the converted records to the external system (the channel depends on project specification).
-
For more details on Push and Pull methods, see the IntegrationManager documentation.
RabbitMQ Delivery and Retries
Since version 17.3, Pricefx retries RabbitMQ delivery instead of losing the event.
Pricefx sends each event to RabbitMQ in one of two ways:
-
Direct send: Pricefx publishes the event as soon as the request or job that created it finishes. This normally delivers every event within seconds.
-
Background retry: about once a minute, a background process looks for events that are not delivered yet and sends them.
The background retry handles only events that the direct send could not deliver. Two waiting periods keep both from sending the same event:
|
Waiting period |
Default |
Purpose |
|---|---|---|
|
Grace period for new events |
6 hours ( |
The background retry leaves new events to the direct send. A long job publishes its events only when it finishes, so this period must be longer than any job. It matters only when the direct send never started, for example because a server node stopped. |
|
Claim during a send |
30 minutes ( |
Before either sender publishes an event, it claims the event, and the other sender skips claimed events. If a node stops during the send, the claim expires after 30 minutes. The background retry then sends the event. |
What you see in the Events log:
|
Situation |
MQ Retries Left |
MQ Error Message |
What happens next |
|---|---|---|---|
|
Delivered |
-1 |
(empty) |
Nothing. |
|
Waiting for the first send |
5 |
(empty) |
The direct send delivers it, or the background retry does after the grace period. |
|
RabbitMQ rejected the event |
1 to 4 |
The error |
Pricefx retries 5 minutes later. Each rejection lowers the count by one. |
|
RabbitMQ is unavailable |
5 |
"MQ channels down" |
Pricefx retries every 5 minutes until RabbitMQ is back. These attempts do not lower the count. |
|
The job or request that created the event failed |
0 |
"Not sent as the job or request that created it failed" |
Pricefx does not send the event. |
|
No retries left, or RabbitMQ was turned off for the partition |
0 |
The last error or the reason |
Pricefx does not retry the event. To send it, use Resending Events to RabbitMQ. |
|
Created while the legacy kill switch was on |
(empty) |
(empty) |
Pricefx never retries the event. |
Each RabbitMQ message contains eventId, the ID of the event record. Delivery is at least once. A consumer can receive the same event twice, for example after a server node stops during a send. Consumers must deduplicate by eventId.
The feature flag MQEvents.PFUN-35653.revertToLegacyMQEventsNoRetries.KillSwitch restores the behavior from before version 17.3. When the flag is on, Pricefx still stores the event, sends it once and only logs a failure. These events have an empty MQ Retries Left and Pricefx never retries them, even after you turn the flag off.