By Jernej Kaše on May 30, 2015
I've blogged about how to consume REST with Oracle Stream Explorer, this time we are going to take a look how to configure stream explorer to send events to a REST service.
We'll start by creating an exploration which summarises tweets per minute per each of the keywords we have:
Configuring a REST target
Configuring a target is as simple as a few clicks. Just click the "Configure a target" button, select REST from the dropdown and enter your REST service url. Note that building the service is not in the scope of this blog, suffice to say it should expect parameters which your exploration emits.
Once the target is configured, deploy the exploration. One would expect the REST service to start receiving the events now. Instead, you might find an error in your oep server log
The key here is "Failed to set property 'cOUNT_of_text'". If you look at the first screenshot at the top, you'll notice that "COUNT_OF..." is automatically created when we summarise data in the exploration. However, Stream Explorer is - for reason unknown to me - at the moment not able to send this variable to the RESt service.
The workaround is quite simple. Maybe it's not obvious, but it's possible to rename exploration columns. Just click properties, select a property and then click on the pencil icon
In example above I renamed COUNT_of_text to tweetsPerMinute.
With this change just redeploy the exploration (and your REST service if required), and you should be able to receive data just fine.
Jernej Kaše is a Fusion Middleware Specialist working closely with Oracle Partners