Skip to content

Instantly share code, notes, and snippets.

@rossmason
Created June 9, 2011 16:26
Show Gist options
  • Save rossmason/1017109 to your computer and use it in GitHub Desktop.
Save rossmason/1017109 to your computer and use it in GitHub Desktop.
<mule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:magento="http://www.mulesoft.org/schema/mule/magento"
xmlns:mongodb="http://www.mulesoft.org/schema/mule/mongodb"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/magento http://www.mulesoft.org/schema/mule/magento/1.2/mule-magento.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/mongodb http://www.mulesoft.org/schema/mule/mongodb/3.1/mule-mongodb.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.0/mule-http.xsd">
<magento:config name="MagentoTest" username="${magentoUsername}"
password="${magentoPassword}" address="${magentoAddress}" />
<mongodb:connector name="mongodb" database="${mongoDatabase}" hostname="${mongoHostname}" />
<flow name="GetPriceUpdates">
<description>Looks for product price updates in a mongo db</description>
<mongodb:outbound-endpoint
collection="priceUpdates"
query='{}'
exchange-pattern="request-response"/>
</flow>
<flow name="UpdateProductPrice">
<description>Updates product prices based on price updates in mongodb</description>
<magento:update-product productSku="#[ognl:get('sku')]">
<magento:attributes>
<magento:attribute key="price" value="#[ognl:get('price')]"/>
</magento:attributes>
</magento:update-product>
</flow>
<flow name="MainFlow">
<description>For each update in a mongodb, update the corresponding product in magento</description>
<http:inbound-endpoint host="localhost" port="9091" path="magento-demo-update-product" />
<flow-ref name="GetPriceUpdates"/>
<collection-splitter/>
<flow-ref name="UpdateProductPrice"/>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment