Skip to content

Instantly share code, notes, and snippets.

<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-jira</artifactId>
<version>1.1</version>
</dependency>
<jira:add-comment issueKey="XYZ-123" commentAuthor="Federico" commentBody="This is the comment for the issue"/>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jira="http://www.mulesoft.org/schema/mule/jira"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/jira http://www.mulesoft.org/schema/mule/jira/1.0/mule-jira.xsd">
mvn archetype:generate -DarchetypeGroupId=org.mule.tools.devkit -DarchetypeArtifactId=mule-devkit-archetype-generic -DarchetypeVersion=3.0.1 -DarchetypeRepository=http://repository.mulesoft.org/releases/ -DgroupId=org.mule -DartifactId=google-maps-connector -Dversion=1.0 -DmuleVersion=3.2.0 -DmuleModuleName=GoogleMaps
package org.mule;
import org.mule.api.annotations.Module;
import org.mule.api.ConnectionException;
import org.mule.api.annotations.Configurable;
import org.mule.api.annotations.Processor;
@Module(name="googlemaps", schemaVersion="1.0")
public class GoogleMapsModule
{
@Module(name="googlemaps", schemaVersion="1.0")
public class GoogleMapsModule
{
private static final String PROTOTYPE_URL =
"http://maps.googleapis.com/maps/api/distancematrix/xml?origins=%s&destinations=%s&units=%s&sensor=false";
private static final String DISTANCE_XPATH = "//DistanceMatrixResponse/row/element/distance/text/text()";
@Configurable
@Optional
@Default("MI")
private DistanceUnit defaultDistanceUnit;
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:googlemaps="http://www.mulesoft.org/schema/mule/googlemaps"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/googlemaps http://www.mulesoft.org/schema/mule/googlemaps/1.0-SNAPSHOT/mule-googlemaps.xsd">
<googlemaps:config myProperty="Some string"
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:googlemaps="http://www.mulesoft.org/schema/mule/googlemaps"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/googlemaps http://www.mulesoft.org/schema/mule/googlemaps/1.0/mule-googlemaps.xsd">
<googlemaps:config distanceUnit ="KM"/>
<flow name="testFlow">
@Test
public void testFlow() throws Exception
{
runFlowAndExpect("testFlow", "23.8 km");
}
@Module(name="googlemaps", schemaVersion="1.0")
public class GoogleMapsModule
{
private static final String PROTOTYPE_URL =
"http://maps.googleapis.com/maps/api/distancematrix/xml?origins=%s&destinations=%s&units=%s&sensor=false";
private static final String DISTANCE_XPATH = "//DistanceMatrixResponse/row/element/distance/text/text()";
@Configurable
private DistanceUnit distanceUnit;
@Processor