The component is responsible for verifying decoded messages.
Communication with the script takes place via grpc, messages are received via rabbit mq.
The component subscribes to the queues specified in the configuration and accumulates messages from them in a FIFO buffer.
The buffer size is configurable, and it is set to 1000 by default.
When the component starts, the grpc server also starts and then the component waits for incoming grpc requests for verification.
Available requests are described in this repository
- CheckSequenceRuleRequest - prefilters the messages and verify all of them by filter. Order checking configured from request. Depending on the request and check1 configuration SilenceCheckRule can be added after the CheckSequenceRule. It verifies that there were not any messages matching the pre-filter in the original request. It awaits for realtime timeout that is equal to clean-up timeout. Reports about unexpected messages only after the timeout is exceeded. Reports nothing if any task is added to the chain.
- CheckRuleRequest - get message filter from request and check it with messages in the cache or await specified time in case of empty cache or message absence.
- NoMessageCheckRequest - prefilters messages and verifies that no other messages have been received.
- WaitForResult - synchronous request waiting for the result of specified rule during specified timeout
- parent_event_id - all events generated by the rule will be attached to that event
- connectivity_id (the
session_alias
insideconnectivity_id
must not be empty)
- direction - the direction of messages to be checked by rule. By default, it is FIRST
- chain_id - the id to connect rules (rule starts checking after the previous one in the chain). Considers * connectivity_id*
- description - the description that will be added to the root event produced by the rule
- timeout - defines the allowed timeout for messages matching by real time. If not set the default value from check1 settings will be taken
- store_result -
true
indicates that the rule result should be stored for later request usingWaitForResult
method - message_timeout - defines the allowed timeout for messages matching by the time they were received
- checkpoint (must be set if
message_timeout
is used and no validchain_id
has been provided)
- root_filter or filter (please note, that the
filter
parameter is deprecated and will be removed in the future releases)
- root_message_filters or message_filters with at least one filter
(please note, that the
message_filters
parameter is deprecated and will be removed in the future releases)
- pre_filter - pre-filtering for messages. Only messages that passed the filter will be checked by the main filters.
- check_order - enables order validation in message's collections
- silence_check - enables auto-check for messages that match the
pre_filter
after the rule has finished
- pre_filter pre-filtering for messages that should not be received.
- rule_id - the id of rule
- timeout - timeout for waiting for result
- rules - list of rules to submit
- default_parent_event_id - default value for
parent_event_id
of submitted rules. - default_chain - default value for
parent_event_id
of submitted rules.
the same as SubmitMultipleRules
but returns immediately with Empty
response
General view of the component will look like this:
apiVersion: th2.exactpro.com/v1
kind: Th2Box
metadata:
name: check1
spec:
image-name: ghcr.io/th2-net/th2-check1
image-version: <image version>
custom-config:
message-cache-size: '1000'
cleanup-older-than: '60'
cleanup-time-unit: 'SECONDS'
max-event-batch-content-size: '1048576'
rule-execution-timeout: '5000'
auto-silence-check-after-sequence-rule: false
time-precision: 'PT0.000000001S'
decimal-precision: '0.00001'
enable-checkpoint-events-publication: true
rules-execution-threads: 1
type: th2-check1
pins:
- name: server
connection-type: grpc
- name: from_codec_proto
connection-type: mq
attributes: [ 'subscribe', 'parsed' ]
- name: from_codec_transport
connection-type: mq
attributes: [ 'subscribe', 'transport-group' ]
extended-settings:
service:
enabled: true
nodePort: '<port>'
envVariables:
JAVA_TOOL_OPTIONS: "-XX:+ExitOnOutOfMemoryError"
resources:
limits:
memory: 200Mi
cpu: 200m
requests:
memory: 100Mi
cpu: 50m
This block describes the configuration for check1.
{
"message-cache-size": 1000,
"cleanup-older-than": 60,
"cleanup-time-unit": "SECONDS",
"max-event-batch-content-size": "1048576",
"rule-execution-timeout": 5000,
"auto-silence-check-after-sequence-rule": false,
"time-precision": "PT0.000000001S",
"decimal-precision": 0.00001,
"check-null-value-as-empty": false,
"enable-checkpoint-events-publication": true,
"rules-execution-threads": 1
}
The number of messages for each stream (alias + direction) that will be buffered.
The time before the verification chain (from a task that is complete) will be removed. The value will be interpreted as time unit defined in cleanup-time-unit setting. The default value is set to 60
The time unit for cleanup-older-than setting. The available values are MILLIS, SECONDS, MINUTES, HOURS. The default value is set to SECONDS
Minimum interval between cleanups in milliseconds. Default value is 1000 milliseconds.
The max size in bytes of summary events content in a batch defined in max-event-batch-content-size setting. The default value is set to 1048576
The default rule execution timeout is used if no rule timeout is specified. Measured in milliseconds
Defines a default behavior for creating CheckSequenceRule if silence_check
parameter is not specified in the request.
The default value is false
The time precision is used to compare two time values. It is based on the ISO-8601
duration format PnDTnHnMn.nS
with
days considered to be exactly 24 hours. Additional information can be
found here
The decimal precision is used to compare the value of two numbers. Can be specified in number or string format. For
example 0.0001
, 0.125
, 125E-3
check-null-value-as-empty
is used for EMPTY
and NOT_EMPTY
operations to check if NULL_VALUE
value is empty. By
default, this parameter is set to false
. For example, if the checkNullValueAsEmpty
parameter is:
true
, thenNULL_VALUE
is equal toEMPTY
, otherwiseNULL_VALUE
is equal toNOT_EMPTY
Enables event publication for each stream that was added into checkpoint. Otherwise, only top events with attached messages will be published. Enabled by default.
Configures number of threads for rules execution.
This option can help to increase performance when you are going to calculate heavy rules, and you haven't got strict CPU limitation,
otherwise use 1
thread for rule execution.
The default value is 1
The Check1 component has two types of pin:
- gRPC server pin: it allows other components to connect via
com.exactpro.th2.check1.grpc.Check1Service
class. - MQ pins: they are used for listening to protobuf and th2 transport parsed messages. You can link several sources with different directions and session aliases to it.
apiVersion: th2.exactpro.com/v1
kind: Th2Box
metadata:
name: check1
spec:
pins:
- name: server
connection-type: grpc
- name: from_codec_proto
connection-type: mq
attributes:
- 'subscribe'
- 'parsed'
- name: from_codec_transport
connection-type: mq
attributes:
- 'subscribe'
- 'transport-group'
The Check1 component publishes Prometheus metrics to observe the actual state of it
th2_check1_actual_cache_number
- actual number of messages in cachesth2_check1_active_tasks_number
- actual number of currently working rules
The th2_check1_actual_cache_number
metric separate messages with three labels:
book_name
- book name of received messagesession_alias
- session alias of received messagedirection
- direction of received message
The th2_check1_active_tasks_number
metric separate rules with label rule_type
NoMessageCheck
rule publishesnoMessageCheckExecutionStop
event with statusSUCCESS
when user requests check withmessage_timeout
= 0 or without it and the rule is completed byTIMEOUT
reason.- Updated th2 gradle plugin:
0.1.3
(bom:4.8.0
)
- Migrated to th2 gradle plugin
0.1.1
(bom:4.6.1
) - Updated grpc-check1:
4.4.1-dev
- Updated common:
5.14.0-dev
- Updated common-utils
2.3.0-dev
- workflows update
multiSubmitRules
grpc method (grpc-check1:4.4.0-dev
)min-cleanup-interval-ms
configuration parameter to specify minimal interval between rules cleanup
- Support for disabling of order verification for simple collection
- Switch for events publication in checkpoint request. Parameter
enable-checkpoint-events-publication
should be used for that WaitForResult
method added
- Configure number of threads for rules execution. Parameter
rules-execution-threads
- common:
5.6.0-dev
- grpc-check1:
4.3.0-dev
- rxjava:
2.2.21
- Changes from 3.10.0 version
- verification event now displays the field as failed if it has nested failed field(s)
sailfish-utils
could not work withBigInteger
that is decoded in th2 transport parsed messages (when value does not fit intoLong
)
- bom:
4.5.0-dev
- common:
5.4.0-dev
- common-utils:
2.2.0-dev
- sailfish-utils:
4.1.0-dev
- kotlin:
1.8.22
- Support for listening to messages using th2 transport protocol from a queue
-
Used
saifish-common
instead ofsailfish-core
-
Migrated to bom
4.4.0
-
Migrated to common
5.3.1-dev
-
Migrated to common-utils
2.1.0-dev
-
Migrated to sailfish-utils
4.0.0-dev
- Updated org.owasp.dependencycheck:
8.3.1
- Vulnerability scanning
- Dev release workflow
- Excluded vulnerable transitive dependencies from sailfish
- Migrated to common
5.2.0-dev
book_name
entity has been added to theSessionKey
class as a property and into theth2_check1_actual_cache_number
metric as a label
- Migrated to books/pages cradle 4.0.0
- Migrated
common
version from3.31.3
to4.0.0
- Migrated
grpc-check1
version from3.5.1
to4.0.0
- Migrated
- Excluded
apache-mina-core
from dependencies list
- Excluded
junit
from dependencies list
- Migrated
common
version from3.44.0
to3.44.1
- Updated bom to
4.2.0
- Excluded
apache-mina-core
from dependencies list
- Excluded
junit
from dependencies list
- Migrated
common
version from3.44.0
to3.44.1
- Updated bom to
4.2.0
- Support for disabling of order verification for simple collection
- Switch for events publication in checkpoint request. Parameter
enable-checkpoint-events-publication
should be used for that.
- Migrated
common
version from3.31.3
to3.44.0
- Migrated
sailfish-utils
version from3.12.2
to3.14.0
- sailfish updated to 3.3.54
- Improved condition output format for
EQ_PRECISION
,WILDCARD
,LIKE
,IN
,MORE
,LESS
operations and their negative versions
- Changed the way the check1 works with threads internally. Now it uses a common executor for running check rules instead of creating an executor per each rule
- Implemented NoMessageCheck rule task. Updated CheckRule and CheckSequence rule tasks
- New configuration parameter
rule-execution-timeout
which is used if the user has not specified a timeout for the rule execution - Auto silence check after the CheckSequenceRule.
auto-silence-check-after-sequence-rule
to setup a default behavior for CheckSequenceRule- New configuration parameter
time-precision
which is used if the user has not specified a time precision - New configuration parameter
decimal-precision
which is used if the user has not specified a number precision - New parameter
hint
for verification event which is used to display the reason for the failed field comparison. For example the type mismatch of the compared values - New configuration parameter
check-null-value-as-empty
witch us used to configure theEMPTY
andNOT_EMPTY
operations
- Migrated
common
version from3.26.4
to3.31.3
- Migrated
grpc-check1
version from3.4.2
to3.5.1
- Migrated
sailfish-utils
version from3.9.1
to3.12.2
- Fixed conversion of
null
values - Add marker for
null
values to determine whether the field was set withnull
value or was not set at all - Allow checking for exact
null
value in message - Added new parameter
checkNullValueAsEmpty
in theFilterSettings
- Fixed conversion of
- Corrected verification entry when the
null
value and string"null"
looked the same for the expected value - Fixed setting of the
failUnexpected
parameter while converting a message filter - Migrated
sailfish-core
version to3.2.1752
- Fix incorrect matching in repeating groups with reordered messages
- Added check for positive timeout
- Added mechanism for handling exceptions when creating and executing rules which publishes events about an error that has occurred
- Added metric for monitoring active rules and messages count
- Added check for required message type in the message filter
- Provided more detailed logging in comparable messages
- Provided the ability to attach verification description to event
- Provided the ability to verify repeating groups according to defined filters via
check_repeating_group_order
parameter in theRootComparisonSettings
message
- Migrated
common
version from3.25.0
to3.26.4
- Added support for converting SimpleList to readable payload body
- Added the new
description
parameter toRootMessageFilter
message
- Migrated
grpc-check1
version from3.2.0
to3.4.2
- Migrated sailfish-utils from
3.7.0
to3.8.1
- Now Check1 keep the order of repeating result groups by default
- Fix IN, NOT_IN FilterOperation interaction
- The root event name is now shorter. The additional information about session alias and direction is moved to the event body. The user's description should be displayed more clearly in the report.
- Migrated common version from
3.23.0
to3.25.0
- Improved message filter table view
- Added functional for 'IN', 'LIKE', 'MORE', 'LESS', 'WILDCARD' FilterOperations and their negative versions
- Fixed a problem where rule completes check before the timer for execution has been scheduled
- Fixed configuration for gRPC server
- Added the property
workers
, which changes the count of gRPC server's threads
- Added the property
- Disable waiting for connection recovery when closing the
SubscribeMonitor
- fixed a problem while using full verification instead of verification by key fields in matching-filter of sequence rule when order check is disabled
- moves the message cursor in the message stream when a filter is matched by the key fields
- creates events with a message filter
- fixed an event layout problem for the sequence check rule
- Added the max-event-batch-content-size option
- Fix problem with missing key field markers in verification entry
- removed gRPC event loop handling
- fixed dictionary reading
- reads dictionaries from the /var/th2/config/dictionary folder.
- uses mq_router, grpc_router, cradle_manager optional JSON configs from the /var/th2/config folder
- tries to load log4j.properties files from sources in order: '/var/th2/config', '/home/etc', configured path via cmd, default configuration
- update Cradle version. Introduce async API for storing events