JBoss.orgCommunity Documentation
There are two examples to demonstrate the conversation aware ESB actions(for both stateful and stateless), and the conformance checking against a choreography.
These are purchasing
, a simple customer/supplier example with two associated Eclipse projects (purchasing-store-stateful/less
and purchasing-models
), and brokerage
which extends the purchasing example through the introduction of a broker that mediates between potentially multiple suppliers to find the best deal, defined within three Eclipse projects (brokerage-broker-stateful/less
, brokerage-supplier-stateful/less
and brokerage-models
).
These examples make use of a common Credit Agency service, defined within the common-creditAgency-stateful/less
Eclipse project, and are executed through the use of client applications defined in the ${OverlordCDL}/samples/client
folder.
The purchasing example describes the interactions between a Buyer, Store and Credit Agency. The flow for this example would be:
To check conformance, we need to refer to the model and service implementation projects in the Eclipse environment.
The purchasing-models
project contains the CDL used to perform conformance checking on the src/main/resources/META-INF/jboss-esb.xml
files within the other projects. A full explanation of the conversation aware ESB actions can be found in the Conversational Aware ESB section of the User Guide in the docs
folder.
To provide a simple demonstration of the conformance checking:
purchasing-store[-stateful/less]/src/main/resources/META-INF/jboss-esb.xml
The information regarding the expected message type is obtained from the choreography description in the purchasing-models
project. To identify the precise interaction within the choreography that this error relates to, select the context menu associated with the error and choose the Quick Fix menu item. This will display a dialog with a list of fixes, select the Show referenced description option and press OK. This will cause the relevant interaction within the choreography description to be displayed.
Another Quick Fix option associated with this error is Update from Referenced Description. By selecting this option, you will notice that the message type is changed back to the value without the 'X'.
This example has two versions, stateful and stateless. in the sample folder, you will find the samples were grouped in stateful and stateless folder. One is the stateful purchasing example (this is the example that we had since M1 release),the other is stateless purchasing example that is introduced in the M2 release.
$Overlord/samples/stateful
folder (or $Overlord/sample/stateless
in the stateless approach), execute the ant deploy-purchasing.
$Overlord/samples/client
folder and execute ant runPurchasingClient (or ant runStatelessPurchasingClient in stateless approach.), which will send a 'BuyRequest' message to the Store, which will then perform the credit check before returning a response to the client.
To see a different response from the client, change the isCreditValid method on the CreditAgencyPurchase class to return false, within the common/creditAgency
ESB service implementation, and then re-deploy the Credit Agency service. Then when the client is re-run, a 'BuyFailed' message will be returned.
You can undeploy the corresponding esb artifact by through command ant undeploy-purchasing
in the $Overlord/samples/stateful
folder or $Overlord/samples/stateless
folder respectively.
The brokerage example describes the interactions between a Customer, Broker, Supplier and Credit Agency. The flow for this example would be:
To check conformance, we need to refer to the model and service implementation projects in the Eclipse environment.
The brokerage-models
project contains the CDL used to perform conformance checking on the src/main/resources/META-INF/jboss-esb.xml
files within the other brokerage projects. A full explanation of the conversation aware ESB actions can be found in the Conversational Aware ESB section of the User Guide in the docs
folder.
To provide a simple demonstration of the conformance checking:
brokerage-broker[-stateful/less]/src/main/resources/META-INF/jboss-esb.xml
The information regarding the expected message type is obtained from the choreography description in the brokerage-models
project. To identify the precise interaction within the choreography that this error relates to, select the context menu associated with the error and choose the Quick Fix menu item. This will display a dialog with a list of fixes, select the Show referenced description option and press OK. This will cause the relevant interaction within the choreography description to be displayed.
This example has two versions, stateful and stateless. in the sample folder, you will find the samples were grouped in stateful and stateless folder. one is the sateful broker example (this is the example that we had since M1 release), the other is stateless broker example that is introduced in the M2 release.
$Overlord/samples/stateful
folder (or $Overlord/samples/stateless
in the stateless approach), execute ant deploy-broker$Overlord/samples/client
folder and execute ant runBrokerageClient (or ant runStatelessBrokerageClient in stateless approach), which will initially send an 'enquiry' message to the Broker, which will communicate with the set of Suppliers to obtain the best quote. The client will then send a 'buy' request, which will result in the Broker performing a credit check before returning a response to the client.
You can undeploy the corresponding esb artifact by through command ant undeploy-broker
in $Overlord/samples/stateful or $Overlord/samples/stateless respectively.