Skip to content

Latest commit

 

History

History
163 lines (111 loc) · 6.62 KB

isds.adoc

File metadata and controls

163 lines (111 loc) · 6.62 KB

Camel ISDS

Maven users will need to add the following dependency to their pom.xml for this component:

    <dependency>
            <groupId>com.github.czgov</groupId>
            <artifactId>camel-isds</artifactId>
            <version>${use.latest.from.maven.central}</version>
    </dependency>

The recomended approach is to use some BOM (Bill of Materials) to avoid version conflicts. There is issue for real BOM in Camel project but camel-parent can be used until then.

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-parent</artifactId>
        <version>${camel.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.github.czgov</groupId>
      <artifactId>camel-isds</artifactId>
      <version>${use.latest.from.maven.central}</version>
    </dependency>
  </dependencies>

URI format

isds:messages?options

Supported operations

isds:messages

For sending and receiving messages.

isds:download

For downloading of specific isds message by it’s id.

Important exchange headers

Header Default value Description

isdsId

null

download message with this ID

isdsType

received

download message you received. You may also download message you "sent"

When downloading message by it’s id with isds:download, you might see this error:

Nemohu stahnout prijatou zpravu. 1222:Zprava dosud nebyla oznacena jako dorucena, proto ji nelze cist.

This is caused by security feature of ISDS. According to this feature it’s forbidden to download message which wasn’t marked as delivered. You may use option isds:download?downloadListMessages=true get around that. Component will first call getListOfReceivedMessages API method to trigger "delivered event" and then it should work.

Operations planned for next releases are:

  • search for searching of databoxes based on given query

ISDSEndpoint Options

The ISDS component supports 16 endpoint options which are listed below:

Name Group Default Java Type Description

operation

common

ISDSOperation

Required Which operation should be used with isds.

attachmentStore

common

camel-isds-attachment-store

Path

folder for storing message attachments

environment

common

production

ISDSEnvironment

Determine if you want to use real ISDS system or just testing one. Default value is real (production) system.

password

common

String

Required Password for ISDS system

realtime

common

false

boolean

Setting realtime to true will override options code fromto. Assuming code consumer.delay=1m then code from=now - 1 minute and code to=now.

username

common

String

Required Username for ISDS system.

bridgeErrorHandler

consumer

false

boolean

Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.

filter

consumer

!read

MessageState>

Download only messages which are specified in filter. Null or empty for all.

markDownloaded

consumer

true

boolean

Set ISDS message as downloaded after successful processing of exchange

zfo

consumer

false

boolean

Download message as binary (signed) zfo data instead of Message instance.

exceptionHandler

consumer (advanced)

ExceptionHandler

To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.

from

consumer (advanced)

0L

Date

Download only messages received after this date. If using the URI the pattern expected is: code yyyy-MM-dd HH:mm:ss or code yyyy-MM-dd’T’HH:mm:ss.

to

consumer (advanced)

Long.MAX_VALUE

Date

Download only messages received before this date. If using the URI the pattern expected is: code yyyy-MM-dd HH:mm:ss or code yyyy-MM-dd’T’HH:mm:ss.

downloadListMessages

producer

false

boolean

First call getListOfReceivedMessages before downloading message by it’s ID. See documentation of ISDS section 1.6.2.2 Novy Stav. User must login into ISDS in order to download messages. The only API method that causes user logged in event is getListOfReceivedMessages. ISDS may throw error number 1222 when downloading message if this option is set to false;

exchangePattern

advanced

InOnly

ExchangePattern

Sets the default exchange pattern when creating an exchange

synchronous

advanced

false

boolean

Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).

ISDSComponent Options

The ISDS component has no options.

Consumer Endpoints

ISDSConsumer extends ScheduledPollConsumer. This means that you can use ScheduledPollConsumerOptions with prefix consumer.

For example to set polling period to 72 hours, you can use:

from("isds:messages?environment=test&username=USERNAME&password=PASSWORD&consumer.delay=72h")
		.log("new message ${body}");