Versions Compared

Key

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

...

  • Server
    Acts as a server if the 'Create Socket?' property is set to trueenabled. In server mode adapter will create the Server mode, this microservice creates a socket on the configured port provided in the component property sheet and listens for connections. Once a connection is created, messages coming on the input port will be sent to the connected client/clients and the messages received from the client will be sent to output the output port.
  • Client
    Acts as a client if the 'Create Socket ?' property is set to falseenabled. In client mode adapter will connect the Client mode, this microservice connects to the socket configured. If a successful connection is made, then the message coming on the input port will be sent to the server and the received messages will be sent to the output port.

...

Tip

Refer Error Handling section in Common Configurations for detailed information.

CreateSocket?

 

  • Enable - Acts as a server by creating a socket on the specified port and listens to client connections.

    Note

    Enabling this property

    • disables the properties Connection Idle Timeout and Is Synchronous? too.
    • makes the Block Clients property available for configuration.

 

  • Disable - Acts as a client assuming that the server is already running on the specified port and connects to it.

...

This is a property present at the Client side. If enabled, it specifies that the client needs to communicate with the server authenticated by a specified Key Pair. If disabled, the client will accept any server key pairs.

 

KeyPairPath

Key pair should be provided at run time runtime by the user at both client side and the server side for proper authentication. A key pair in ".pem" format is required by the SSH library to perform the key exchange and verification.

 

Note

 


Figure 8: CPS with SSH and Key Pair properties enabled

Threadpool Configuration

This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Note
  • This needs to be used only in such circumstances.
  • If sequential processing is not required, please use sessions on the input port.

Click the Threadpool Configuration ellipsis button to configure the Threadpool Configuration properties.

Image Added
Figure 9: Threadpool Configuration dialog box

Enable Thread Pool

Enable this option to configure the properties that appear as below.

Pool Size

Number of requests to be processed in parallel within the component. Default value is '1'.

Batch Eviction Interval (in ms)

Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.

Anchor
Block Clients
Block Clients
Block Clients

This property will be visible in the CPS only if the Create Socket property is enabled and hence is displayed only at the server side. This property is used to deny access to a particular client or a set of clients as specified using the IP addresses.

When this property is enabled, Blocked Clients IP Pattern property gets visible where the IP pattern referring to the clients who needs to be blocked can be specified.

Blocked Clients IP Pattern

Provide the IP address or a range of IP addresses to deny access of a particular client or multiple clients respectively.

Image Added
Figure 10: Attributes to specify the IP address(es) to be blocked

Tip

A single range of a series of IP addresses may be specified as well as multiple ranges may be provided separated by semicolons.

Note
titleExamples of various patterns
Info
titleSingle Range - 192.168.1.0 to 192.168.1.99

 192.168.1.\b([0-9]|[0-9][0-9])\b

Info
titleMultiple Range - 192.168.1.0 to 192.168.1.100 & 192.168.1.101 to 192.168.1.200 & 192.168.1.201 to 192.168.1.255

 192.168.1.\b([0-9]|[0-9][0-9]|100)\b;192.168.1.\b(1[0-9][0-9])|200)\b;192.168.1.\b(2[0-4][0-9]|25[0-5])\b

Functional Demonstration

The following Sample flow has two socket microservices, one acting as the server and the other as client. After receiving requests from the client, the server will send it to the SMTP component connected to its output port, and then the response from the SMTP component is, in turn, sent back to the client.


Figure 911: Sample Event Process

Scenario 1: Decode Type as 'Delimiter'

'SampleServer' Component Configuration is shown in the following figure.


Figure 1012: Socket Adapter Configuration in Server mode

'SampleClient' Component Configuration is shown in the following figure.


Figure 1113: Socket Adapter Configuration in Client mode

...

'SampleServer' Component Configuration is shown in the following figure.


Figure 1214: Socket Adapter Configuration in Server mode

'SampleClient' Component Configuration is shown in the following figure.


Figure 1315: Socket Adapter Configuration in Client mode

...

The following Sample flow has one socket adapter acting as client. After receiving requests from the client, the configured WSSStub (as Server) sends the response back to the client. In the client configuration, SuspendTimeout is 10 sec. If the client fails to receive response within the configured suspendtimeout (10 sec), then the next request message sent by client will be processed and a timeout error message is sent to the Error port of the client.


Figure 1416: Sample Event Process


Figure 1517: Socket Adapter Configuration in Client mode for Synchronous Communication


Figure 1618: Sample Request


Figure 1719: Sample Response

Info

Is Synchronous? option can be used with any Decode Type (Delimiter/ Length/None).

...

Adaptavist ThemeBuilder EngineAtlassian Confluence