Skip to content

Offloading

Raymond Meester edited this page Apr 26, 2023 · 7 revisions

What is offloading?

Offloading collects and stores events that happen in Assimbly runtime. The main use case for offloading is to save data for monitoring and analysis.

Since Assimbly 3.9.0

Offloading

Collectors

There are three type of collectors:

1. Log

Collects log events (from the log file).

Log events can be a package name or a Class name. For example:

  • org.assimbly
  • org.camel

All possible package names can found from Administration --> Logs

2. Step

Collects events on a flow step (for example starting and stopping of steps).

The following step events can be collected:

  • RouteAdded
  • RouteReloaded
  • RouteRemoved
  • RouteStarted
  • RouteStarting
  • RouteStopped
  • RouteStopping

3. Message

Collect message events (message processed by the flow).

The following step events can be collected:

  • ExchangeAsyncProcessingStarted
  • ExchangeCompleted
  • ExchangeCreated
  • ExchangeFailed
  • ExchangeFailure
  • ExchangeFailureHandled
  • ExchangeFailureHandling
  • ExchangeRedelivery
  • ExchangeSending
  • ExchangeSent

How to configure offloading?

Configuration fields

Field Explanation Values
id Identifier of the collector String
type Type of collector log | step | message
events Type of events Depends on type of collector
stores Type of stores console | file | elastic
filters Filter on the events Regex

Configuration endpoint

For the offloading there is a special REST API endpoint:

/api/integration/{integrationId}/collector/{collectorId}/add

There you can add the integrationId (1 by default), the collectorId and the configuration as a json file.

Configuration examples:

Log collector

{
	"id": "1",
	"type": "log",
	"events": [
		"org.assimbly",
		"org.camel"
	],
	"stores": [
		{
			"type": "file",
			"uri": "C:/messages/events/mylogs.log"
		},
		{
			"type": "console"
		}
	],
	"filters": [
		{
			"filter": "flowid=1"
		}
	]
}

Step collector

{
	"id": "3",
	"type": "step",
	"events": [
		"RouteReloaded",
		"RouteStarted",
		"RouteStarting",
		"RouteStopped",
		"RouteStopping"
	],
	"stores": [
		{
			"type": "file",
			"uri": "C:\path\to\my.log"
		}
	],
	"filters": [
		{
			"id": "1",
			"filter": "1-1"
		}
	]
}

message collector

{
	"id": "2",
	"type": "message",
	"events": [
		"ExchangeCompleted",
		"ExchangeCreated"
	],
	"stores": [
		{
			"type": "console"
		},
		{
			"type": "elastic",
                        "uri": "http://localhost:9200/transactions/_doc",
			"expiryInHours": "8"
		}
	],
	"filters": [
		{
			"id": "1",
			"filter": "1-1"
		}
	]
}

Remove collector configuration

A collector can be removed (stop collecting) be calling the following endpoint

DELETE /api/integration/{integrationId}/collector/{collectorId}/remove

Multiple configuration add once

It's also possible to set multiple configurations at once using the following endpoint:

/api/integration/{integrationId}/collectors/add

Example configuration for multiple collectors

[{
	"id": "1",
	"type": "log",
	"events": [
		"org.assimbly",
		"org.apache.camel"
	],
	"stores": [
		{
			"type": "file",
			"uri": "C:/messages/events/logs-events.log"
		}
	],
	"filters": [
		{
			"filter": "flowid=1"
		}
	]
},
{
	"id": "2",
	"type": "step",
	"events": [
		"RouteAdded",
		"RouteStarting",
		"RouteStopped",
		"RouteStopping"
	],
	"stores": [
		{
			"type": "file",
			"uri": "C:/messages/events/step-events.log"
		}
	],
	"filters": [
		{
			"id": "1",
			"filter": "1-1"
		},
		{
			"id": "1",
			"filter": "1-2"
		}
	]
},
{
	"id": "3",
	"type": "message",
	"events": [
		"ExchangeCompleted",
		"ExchangeCreated",
		"ExchangeFailed",
		"ExchangeFailure",
		"ExchangeFailureHandled",
		"ExchangeFailureHandling",
		"ExchangeRedelivery",
		"ExchangeSending",
		"ExchangeSent"
	],
	"stores": [
		{
			"type": "file",
			"uri": "C:/messages/events/message-events.log"
		}
	],
	"filters": [
		{
			"id": "1",
			"filter": "1-1"
		}
	]	
}]	
Clone this wiki locally