Enterprise Integration Zone is brought to you in partnership with:

Product Manager for CloudHub Dan is a DZone MVB and is not an employee of DZone and has posted 5 posts at DZone. You can read more from them at their website. View Full User Profile

Exploring the CloudHub Service for Application Data Storage

  • submit to reddit

This CloudHub service arrived in the CloudHub R20 release, harnessing Mule’s Object Store capabilities.  Each integration application is given it’s own storage, with zero configuration required. This makes it a extremely easy to implement two very important integration scenarios:

  1. Persisting OAuth tokens – all our OAuth enabled connectors can store tokens and restore them using ObjectStores
  2. Storing synchronization state – your application may need to keep track of the last record synchronized, so the next time it synchronizes it can resume where it left off

In addition, you can store any other data you want in it as well! Let’s take a more in depth look at these scenarios.

Persisting OAuth tokens

For those using any of our connectors which support OAuth, the first question is always how to save and restore OAuth tokens across the application lifecycle. Now it’s simply a matter of using the Object Store module as documented in each connector. Even better, we’re making it in Mule 3.3.1 so that OAuth token management will work out of the box with no extra configuration.

Storing synchronization state

Another really common use case is storing synchronization state. For example, let’s say that you only want to synchronize new invoices from your CRM into your billing system. You could keep track of the last invoice synchronized and use it in your search query when syncing invoices.

Here’s a quick pseudo sample:

<objectstore:config name="Objectstore" partition="default" doc:name="Objectstore"/>

<flow name="PollForNewInvoices">
    <poll frequency="10000">
        <!-- Get the last invoice synced -->
        <objectstore:retrieve config-ref="Objectstore" key="lastInvoiceId" defaultValue-ref="#[-1]" doc:name="Get Last Invoice ID"/>
    <!-- search for invoices with an ID greater than lastInvoiceId -->
    <flow-ref name="GetUpdatedInvoices"/>
    <!-- Update the last invoice synced -->
    <objectstore:store config-ref="Objectstore" key="lastInvoiceId" value-ref="#[payload[payload.size() - 1].id]" overwrite="true" doc:name="Objectstore"/>

his way even if you update your integration , it’ll resume where it left off.

Viewing your Application Data

Once you’ve got data inside your object store, you can easily view it by clicking on the Application Data tab when managing your CloudHub application. From here you’ll be able to view and search your data. We’re also adding the ability to edit and delete data in the future.

And more?

You can use ObjectStores to store any data that you want (within limits) using the module. Are there are things you would want to use this for? Let us know in the comments!

Published at DZone with permission of Dan Diephouse, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Dan Rios replied on Thu, 2013/03/07 - 2:22pm

Very good must viosit  http://www.bbbclaw.com/personal-injury/

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.