- Simple JMS
- Multi Threaded
- POJO (Plain Old Java Object)
Scripts
The scripts required for generation of these services are present in the following location:
Windows: edbctemplates.bat file present in %FIORANO_HOME%\esb\tools\templates
Linux: edbctemplates.sh file present in %FIORANO_HOME%/esb/tools/templates
Simple JMS
Generating Template
- Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh]
From the command prompt, launch the wizard using %FIORANO_HOME%/esb/tools/templates/edbctemplates.bat [sh]
Syntax:edbctemplates.bat [sh] –dest <dir>
Example- Provide service details in Service Information panel and click Next.
Figure 1: Details of service
- In Runtime Arguments panel, add the required runtime arguments.
Figure 2: Adding runtime arguments
- In the Template Information panel, select 'SimpleJMS' from the Select the template to be used drop-down.
Figure 3: Specifying template to use - Specify the required number of input and output ports and click Finish.
Component Development
Adding Business Logic
Business logic should be added in onMessage(Message msg) method of ${ServiceGUID}MessageListener (in the above example SimpleJMSMessageListener) class
Accessing Runtime Arguments
Runtime arguments passed to the service can be accessed using runtimeArguments.getParameter("<runtime argument>")
Sending Messages on Output Port
Messages can be sent to the required output port using producer.send((Destination) outputDestinations.get("<output port name>"), <message>);
Multi Threaded
Generating Template
- Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh].
From the command prompt, launch the wizard using %FIORANO_HOME%\esb\tools\templates\edbctemplates.bat [sh].
Syntax:edbctemplates.bat [sh] –dest <dir>
Example- Provide service details in theService Information panel and click Next.
Figure 4: Details of service
- In Runtime Arguments panel, add required runtime arguments.
Figure 5: Adding runtime arguments
- In the Template Information panel, select MultiThreaded, specify the required number of input and output ports, and then click Finish.
Figure 6: Specifying template to use
Component Development
Adding Business Logic
Business logic should be added in the execute() method of the ${ServiceGUID}Job (in the above example MultiThreadedJob) class
Accessing Runtime Arguments
Runtime arguments passed to the service can be accessed using runtimeArguments.getParameter("<runtime argument>")
Sending Messages on Output Port
Messages can be sent oto the required output port using sender.send((<message>,"<output port name>");
POJO
Generating Template
- Execute %FIORANO_HOME%\esb\tools\templates\templates-console.bat [sh].
From the command prompt launch the wizard using FIORANO_HOME%\esb\tools\templates\edbctemplates.bat [sh]
Syntax:edbctemplates.bat [sh] –dest <dir>
Example- Provide the service details in the Service Information panel and click Next.
Figure 7: Details of service
- In the Runtime Arguments panel, add the required runtime arguments.
Figure 8: Adding runtime arguments
- In the Template Information panel, select POJO.
- Select jar file containing the required POJO class.
- Select the required method from the list of methods displayed.
Methods with the following signatures alone appear:- public static void <method_name>(String)
- public static void <method_name>(Message)
- public static Message <method_name>(Message)
- public static Message <method_name>(String)
- public static String <method_name>(Message)
- public static String <method_name>(String)
Figure 9: Specifying template to use and selecting required method
Component generated for a POJO contains one input-output pair for each method selected. However, if the return type is void, output port will not be generated for that method.
When a message arrives at an input port, the associated method is invoked, and the response is sent to the respective output port if present.
Component Development
Business logic is generated into component and can be used as it is.