Procedure
-
Double-click the cConfig
component, which is labeled Create_dataset, to display its
Basic settings view in the Component tab and set its parameters.
-
Write a piece of code in the Code field to register the dataset instance foo
into the registry, as shown below.
SimpleDataSet dataset = new SimpleDataSet(1); String messageBody = "testbody"; dataset.setDefaultBody(messageBody); registry.put("foo", dataset);
-
Double-click the input cMessagingEndpoint component, which is labeled Read_dataset, to display its Basic
settings view in the Component
tab.
- In the URI field, enter dataset:foo between the quotation marks.
-
Double-click the cProcessor
component, which is labeled Monitor, to display its Basic settings view in the Component tab.
-
In the Code box, customize the code as
follows so that the Run console displays
the message contents:
System.out.println("Message content: "+ exchange.getIn().toString());
- Press Ctrl+S to save your Route.