Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Connect

The "Connect" component is responsible for the communication with a target system.
This component implements the logic of the interaction protocol, receiving and sending messages from and to the system, respectively.
The "Connect" component is responsible for the communication with the target system.
This component implements the logic of the interaction protocol, by receiving and sending messages from and to the system respectively.

This project includes only an adapter for using the Sailfish service in the th2 packed into a Docker Image.
This image should be used as a base to implement extensions with the real logic for specific protocols using services in the Sailfish format.
This project includes only one adapter for using the Sailfish service in the th2 package into the Docker Image.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence has completely changed its meaning.
This project is the adapter that is packed into the Docker Image. This adapter allows users to use the Sailfish services in the th2

This image should be used as a base to implement extensions with the real logic for the specific protocols, by using services in the Sailfish format.

As an example, the [th2-conn-generic](https://github.com/th2-net/th2-conn-generic) project implements the extension for connecting via FIX protocol using standard Sailfish's FIX service.

## Configuration

This configuration should be specified in the custom configuration block in schema editor.
This configuration should be specified in the custom configuration block at the schema editor.

```yaml
session-alias: "connectivity-alias"
Expand All @@ -22,23 +22,23 @@ settings:
```

Parameters:
+ session-alias - that session alias will be set for all messages received or sent by this component. **It should be unique for each "Connect" component**;
+ workspace - the folder inside the container that will contain a plugin adapted to use in the TH2;
+ type - the service type from **services.xml** file. If service name from services.xml file contains `-` symbols they must be replaced with `_` symbol;
+ name - the service name that will be displayed in the events in the report;
+ session-alias - the session alias specified in this field, will be set for all messages received or sent by this component. **It should be unique for each "Connect" component**;
+ workspace - the folder inside the container which will contain a plugin adapted for using with TH2;
+ type - the service type specified from **services.xml** file. If the service name from services.xml file contains the symbols `-`, they must be replaced with the symbol `_`;
+ name - the service name which will be displayed into the events inside the report;
+ settings - the parameters that will be transformed to the actual service's settings specified in the **services.xml** file.

## Extension

You can add the ability to connect to a target system by implementing your own service in the Sailfish format and putting it and its configuration to the correct places in the base image.
You can add the ability to connect to a target system by implementing your own service in the Sailfish format and by putting it together with its configuration to the correct places into the base image.

You need to take the following steps:
You need to perform the following steps:

1. Create the implementation of the [com.exactpro.sf.services.IService](https://github.com/exactpro/sailfish-core/blob/master/BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/services/IService.java).
1. Create the implementation of [com.exactpro.sf.services.IService](https://github.com/exactpro/sailfish-core/blob/master/BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/services/IService.java).
The examples of implementing this interface can be found [here](https://github.com/exactpro/sailfish-core/tree/master/BackEnd/Service).
If the protocol is already implemented in the Sailfish services you can simply use the dependencies on the service's artifact for that protocol.

2. Create the **services.xml** configuration file that contains the description for services you can use from that "Connect" component.
2. Create the **services.xml** configuration file which contains the description for the services that you can use from the "Connect" component.
You can find the example [here](https://github.com/th2-net/th2-conn-generic/blob/master/conn-fix/src/main/plugin/cfg/services.xml).
This file must contain:
+ service name - the alias to use it from the "Connect" component;
Expand All @@ -58,28 +58,28 @@ This file must contain:
version: 3.2.0.0
core_version: 3.2.0
```
4. Create you own image based on the current one and put all files to the correct places in the base image:
4. Create you own image based on the current one and put all the files to the correct places into the base image:
+ Create the following directory - **${workspace}/plugins/th2_service**.
_**${workspace}**_ - it is a folder from the "Connect" configuration.
If you use the _plugin_alias_ and _name_ different from _th2_service_ in the VERSION file correct the _th2_service_ folder name according to value you use.
_**${workspace}**_ - is a folder from the "Connect" configuration.
If you use the _plugin_alias_ and _name_ different from _th2_service_ in the VERSION file correct the _th2_service_ folder name according to the value that you use.
Let's name that directory as **PLUGIN_DIRECTORY** for simplicity. This name will be used in future steps.
+ Artifact with the service(s) implementation(s) and all its dependencies should be put to the following directory - **${PLUGIN_DIRECTORY}/libs**.
+ The configuration file created on the step 2 should be put to the following directory - **${PLUGIN_DIRECTORY}/cfg**.
+ The _VERSION_ file created on step 3 should be put to the following directory - **${PLUGIN_DIRECTORY}/**.
+ Artifact with the service(s) implementation(s) and all its dependencies should be placed into the following directory - **${PLUGIN_DIRECTORY}/libs**.
+ The configuration file created on the step 2 should be placed into the following directory - **${PLUGIN_DIRECTORY}/cfg**.
+ The _VERSION_ file created on step 3 should be placed into the following directory - **${PLUGIN_DIRECTORY}/**.

## Pins

Connect has 4 types of pins for interacting with th2 components. Messages that were received from / sent to the target system will be sent to the following queues:
Connect has 4 types of pins for interacting with the th2 components. Messages that were received from / sent to the target system will be directed to the following queues:

- incoming parsed messages // it will be removed in future
- outgoing parsed messages // it will be removed in future
- incoming raw messages
- outgoing raw messages

The "Connect" component uses a separate queue to send messages. The component subscribes to that pin at the start and waits for the messages.
The messages received from that pin will be sent to the target system.
Also, this component is responsible for maintaining connections and sessions in the cases where this is provided by the communication protocol.
Here you can automatically send heartbeat messages, send a logon/logout, requests to retransmit messages in the event of a gap, etc.
The "Connect" component uses a separate queue to send messages. The component subscribes to that pin at the start and wait for messages to be received.
The received messages from that pin will be sent to the target system.
Besides, this component is responsible for maintaining connections and sessions , in the cases provided by the communication protocol.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant space before the colon

Suggested change
Besides, this component is responsible for maintaining connections and sessions , in the cases provided by the communication protocol.
Besides, this component is responsible for maintaining connections and sessions, in the cases provided by the communication protocol.

Here you can automatically send heartbeat messages, logon/logout, requests to retransmit messages in the event of a gap, etc.

## Custom resources for infra-mgr

Expand Down