Skip to content

Instantly share code, notes, and snippets.

View djuang1's full-sized avatar
🏠
Working from home

Dejim Juang djuang1

🏠
Working from home
View GitHub Profile
@djuang1
djuang1 / gist:c976a0ca938005608fdf
Last active August 29, 2015 14:11
Mule - MEL - Convert Payload from String to Integer
#[Integer.parseInt(message.outboundProperties.productID)]
@djuang1
djuang1 / gist:5c9e9ca0531864bfa794
Created December 8, 2014 20:05
Mule - MEL - Retrieve Server Time Formatted
#[server.dateTime.withTimeZone('UTC').format('YYYY-MM-dd HH:mm:ss')]
@djuang1
djuang1 / gist:1d5df9e1bc7b3b3b25d5
Created December 8, 2014 20:50
Mule - Groovy - MSCRM 4.0 SOAP Request - Update Account
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import javax.xml.xpath.*;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
@djuang1
djuang1 / gist:9c37b8254f0a24772a59
Created December 8, 2014 20:55
SOAP UI - MSCRM 4.0 Retrieve Account SOAP Request
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:cor="http://schemas.microsoft.com/crm/2007/CoreTypes" xmlns:web="http://schemas.microsoft.com/crm/2007/WebServices" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<web:CrmAuthenticationToken>
<cor:AuthenticationType>0</cor:AuthenticationType>
<cor:OrganizationName>IHSPOC</cor:OrganizationName>
<cor:CallerId>06452A7F-9472-E411-B5C5-22000B5D89F2</cor:CallerId>
</web:CrmAuthenticationToken>
</soap:Header>
<soap:Body>
@djuang1
djuang1 / gist:30e5b5a05dc6b6c86a03
Created December 8, 2014 21:00
Mule - Groovy - MSCRM 4.0 SOAP Request - Retrieve Account
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
import org.apache.http.auth.params.AuthPNames;
@djuang1
djuang1 / mule_logstash.conf
Created October 26, 2015 14:09
MuleSoft ELK Plugin Logstash *.conf File
input {
file {
type => "events"
path => [ "/usr/local/mule/logs/events.log" ]
codec => json
}
file {
type => "analytics"
path => [ "/usr/local/mule/logs/gw-http-events.log" ]
codec => json
@djuang1
djuang1 / mule-redshift-config.xml
Created April 1, 2016 19:47
Sample config for setting up JDBC to connect to Amazon Redshift with the MuleSoft Database Connector
<db:generic-config name="Generic_Database_Configuration" url="jdbc:redshift://${redshift.url}:${redshift.port}/${redshift.database};PWD=${redshift.password};UID=${redshift.username}" driverClassName="com.amazon.redshift.jdbc4.Driver" doc:name="Generic Database Configuration"/>

Keybase proof

I hereby claim:

  • I am djuang1 on github.
  • I am djuang1 (https://keybase.io/djuang1) on keybase.
  • I have a public key whose fingerprint is B849 CB23 9356 7AC6 0329 49B7 A3C1 E27E 6A40 5F4F

To claim this, I am signing this object:

@djuang1
djuang1 / CustomBusinessEventComponent.java
Last active November 23, 2017 10:51
Java code to create Business Event in Mule Management Console (MMC)
package com.mulesoft.dejim;
import java.util.HashMap;
import java.util.Map;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
import org.mule.DefaultMuleEvent;
import org.mule.MessageExchangePattern;
import org.mule.api.MuleEvent;
@djuang1
djuang1 / dropbox.xml
Created January 31, 2017 20:47
Dropbox Mule Example
<file:connector name="File_First" autoDelete="true" streaming="true" validateConnections="true" doc:name="File" />
<http:request-config name="Dropbox_HTTPS_Request_Configuration" protocol="HTTPS" host="content.dropboxapi.com" port="443" basePath="/" doc:name="HTTP Request Configuration">
<tls:context>
<tls:key-store type="jks" path="keystore.jks" keyPassword="<password>" password="<password>"/>
</tls:context>
</http:request-config>
<flow name="upload-first-floor">
<file:inbound-endpoint path="${file.first}" responseTimeout="30000" doc:name="Retrieve File" connector-ref="File_First" pollingFrequency="30000" fileAge="20000">