Citrus and Spring Configuration
Code completion of Citrus system properties in citrus-application.properties
The Configuration options section of the Citrus documentation, mentions a handful of system properties that can be used to configure and customize Citrus with.
To help the discovery of these properties and their values, the following completions are in place:
- property keys in the
citrus-application.properties
with short descriptions of their purposes, - values of the
citrus.default.message.type
property.
Additionally, properties not mentioned in the documentation, but available in the CitrusSettings
class are also provided by the completion, although without description for now.
Validation of configuration in citrus-application.properties
This inspection reports various issues with the configuration of citrus-application.properties
files:
- when the value of
citrus.sharding.number
is outside the [0, total number of shards – 1] allowed range, - when the value of
citrus.sharding.total
is less than 1.
Custom icon for citrus-application.properties
As a visual cue for finding the citrus-application.properties
file in the Project View, Editor tabs, etc. quicker, such files are decorated with a custom icon.
Gutter icon for overridden Citrus Spring beans
Citrus provides extensibility for several validation options via overriding default Spring beans defined in Citrus itself. See:
To help distinguish overridden Citrus-defined Spring beans from others, line markers are added to @Bean
definition methods overriding the aforementioned Citrus-specific beans. The line marker icons are no-op, they are just meant to be a visual aid.
This line marker is disabled by default, because it makes the gutter one column wider which may not be preferred by some.
Override Citrus default bean
In order to simplify the discovery and customization of Citrus specific Spring beans, an action called Override Citrus Spring Bean… is available in editors, in the Alt+Insert and similar Generate menu.
It is available in Spring @Configuration
classes, and it displays the list of bean names whose types are available on the classpath. Upon selection, it generates a @Bean
method with the selected bean name and its associated type.
Generate Citrus Endpoint bean
Citrus ships with many different endpoint implementations that can be created for example as Spring beans for later injection into test classes.
To make the implementation of such endpoint beans easier, an action called Generate Citrus Endpoint Spring Bean… is
available in Spring @Configuration
classes.
It displays the list of endpoint types available on the classpath, and inserts the generated code based on predefined code templates that are available under Settings
/ Editor
/ File and Code Template
/ Code
tab. There is a separate code template for each sync and async endpoint, so they can be customized separately if needed.
The action and the code templates are implemented in a way that they can handle the package structure of both Citrus 3.x and 4.x, depending on which one is used in the project.
The generated code is always inserted after the preceding (based on the caret position) method or field, or right at the beginning of the class body.
Currently supported endpoints:
- citrus-spring-integration:
ChannelEndpoint
andChannelSyncEndpoint
- citrus-jms:
JmsEndpoint
andJmsSyncEndpoint
- citrus-kafka:
KafkaEndpoint
- citrus-http:
HttpClient
andHttpServer
- citrus-ws:
WebServiceClient
andWebServiceServer
- citrus-camel:
CamelEndpoint
andCamelSyncEndpoint