This feed action is responsible for creating the JMS Feed listener and associating it with a Trigger
-
Deploy https://activemq.apache.org/artemis to OpenShift using https://github.com/kameshsampath/jms-feed-provider/artemis/artemis.yml
-
Deploy OpenWhisk on Minishift
Important
|
oc adm policy add-role-to-user admin developer -n openwhisk |
wsk -i package create --shared yes redhatdevelopers (1)
-
this could be anything, if you change it please update pom.xml
openwhisk.package
property
mvn clean package (1) wsk -i action update -a feed true redhatdevelopers/jms-feed \ target/jms-feed-action.jar --main org.workspace7.openwhisk.JmsFeedAction
-
if you have WSK CLI installed, post package
You will need to deploy the JMS Feed Provider before creating the trigger. Refer to the README on the deployment.
wsk -i trigger create jmsTrigger --feed redhatdevelopers/jms-feed \ -p destinationName demo_queue (1) wsk action create jmsTriggerAction src/handler.js (4) wsk rule create jmsEntryRule jmsTrigger jmsTriggerAction (5)
-
If you deployed Artemis using method referenced in Pre-requisite, then the default artemis client name would be is artemis-client and by default this is accessible only from within OpenShift cluster. We make this trigger to have Event Source only from the JMS Destination
demo_queue
-
Create a dummy action just to see what parameters are sent via the event source
-
Associate the Trigger with Action via a rule
Tip
|
|
Infinispan Feed Provider provides
a REST path called /data/add/{destinationName}
which can be used to add dummy entry to see
the cache entry event triggering the jmsTriggerAction
curl -X GET --data "hello world" $(minishift openshift service jms-feed-provider -n myproject --url)/data/add/demo_queue (1) wsk activation list -limit 1 jmsTriggerAction (2) wsk activation result <activation-id> (3)
-
Send a message to JMS Destination
demo_queue
-
Check if the jmsTriggerAction action is triggered as a result of cache entry addition
-
Check what payload the jmsTriggerAction has recevied