Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Expand
titleContents

Table of Contents
indent15px
stylenone

Duplicate content check imicroservice s microservice is used to classify input messages into duplicate and unique based on the content in the input XML at in the XPath provided using CPS. Depending on Cache Duration Time and Sleep Interval, input messages are retained in cache and sent on sleep intervals.

Configuration

Image RemovedImage Added
Figure 1: Component Property Sheet

...

Using schema editor, load/enter the XML schema for the input message. This property will be visible if the input source is chosen as XML.

Image RemovedImage Added
Figure 2: Configure input schema

Sleep Interval

The time gap (in milliseconds) with which duplicate messages are throttled through the Duplicate port.

...

Choose XPath from which content should be extracted. This property will be visible if the Duplicate Identifier Source is selected as BODY.

Image RemovedImage Added
Figure 3: Configure XPath

Property Name

Specify the property name whose value will be used to check if the message is duplicate of the earlier message. This property will be visible if the Duplicate Identifier Source is selected as HEADER.

...

Configure component as shown in Figure 1. Using Feeder send Send input messages and it using Feeder. It can be observed that messages with the same "Author" are classified into duplicate and unique and sent to respective displaysthe display microservices connected to the respective ports.

Image RemovedImage Added
Figure 24: Sample Event Process

Sample Input

Image RemovedSend 10 messages with same "Author" from Feeder.

 

Image Added 
Figure 35: Sent 10 Sending messages with same "Author" using Feeder

Sample Output

Unique port

...

The display window for unique port shows only 1 message which is unique , since cache has no messages at present.

Image Added
Figure 6: Unique Port display window showing the unique message

Duplicate port

Image Removed
Figure 5: Shows The display window for duplicate port shows 9 messages since they have the same Author as the first message

Image Added
Figure 7: Duplicate Port display window showing messages having the same Author as the first message

Note

When the component is restarted, since some acknowledgments may not be received, redelivery of messages takes place. Such messages will be sent to the duplicate port.

To reduce the number of duplicate messages, set the Acknowledgement mode to 'Auto' in the input port of the microservice by clicking the DuplicateContentCheck input port and select "Auto" from the Acknowledge Mode property under Properties > Messaging.

Image Added
Figure 8: Setting the Acknowledge mode to "Auto" to reduce the number of duplicate messages

Useful Tips

  • CPS does not accept negative values for sleep interval and cache duration. Only if values entered are non-negative Validate button press will pop-up Success message.
  • If Cache time is zero, then component throttles messages to Unique port with no gap (sleep interval), irrespective of sleep interval being non-zero value.
  • If sleep interval is zero, then cache is cleared as per cache duration time. While clearing cache, no messages are lost.
Adaptavist ThemeBuilder EngineAtlassian Confluence