Package com.totvs.tjf.messaging
Class MessageFilter
java.lang.Object
com.totvs.tjf.messaging.MessageFilter
Message filter used in listeners.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCheck if it contains the value informed in the message.Check if it contains the value informed in the message.Filters so that only specific messages fall into the listener.Filters so that only specific messages fall into the listener.
-
Constructor Details
-
MessageFilter
public MessageFilter(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
get
Filters so that only specific messages fall into the listener. e.g.@StreamListener(target = TestExchange.INPUT, condition = "headers['type']=='CustomerWithFilter', @MessageFilter.get(payload,'content/name')=='Luke'")In this example, we are filtering so that, only when the content of the name field is Luke, the message is received by the listener. It receives as a parameter the payload and the path of what should be filtered.
- Parameters:
payload- payloadpath- path- Returns:
- the content if it has, or null.
-
get
Filters so that only specific messages fall into the listener. It receives as a parameter theTOTVSMessageand the path of what should be filtered.- Parameters:
message- a TOTVSMessagepath- path- Returns:
get(byte[], String).
-
contains
Check if it contains the value informed in the message.- Parameters:
payload- payloadvalue- value that is going to be checked in the payload- Returns:
- true if it contains, otherwise false.
-
contains
Check if it contains the value informed in the message.- Parameters:
message- a TOTVSMessagevalue- value that is going to be checked in the message- Returns:
contains(byte[], String).
-