Skip to content

Instantly share code, notes, and snippets.

@johndemic
johndemic / gist:2501034
Created April 26, 2012 17:08
copyInboundToOutboundPropertiesTransformer
<spring:beans>
<spring:bean name="copyInboundToOutboundPropertiesTransformer" class="org.mule.transformer.TransformerTemplate" doc:name="Bean">
<spring:constructor-arg>
<spring:bean class="org.mule.pattern.core.support.CopyInboundToOutboundPropertiesTransformerCallback"/>
</spring:constructor-arg>
</spring:bean>
</spring:beans>
@johndemic
johndemic / gist:2500781
Created April 26, 2012 16:28
wss interceptos
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
<spring:bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<spring:constructor-arg>
<spring:map>
<spring:entry key="action" value="UsernameToken" />
<spring:entry key="passwordCallbackRef" value-ref="serverCallback" />
</spring:map>
</spring:constructor-arg>
</spring:bean>
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="memory-dao" delegate-ref="authenticationManager"/>
</mule-ss:security-manager>
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="john" password="password" authorities="ROLE_ADMIN"/>
<ss:user name="anon" password="anon" authorities="ROLE_ANON"/>
</ss:user-service>
@johndemic
johndemic / gist:2500704
Created April 26, 2012 16:20
Mule Namespaces for Security
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="EE-3.2.2" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/
<head>
<script type="text/javascript" src="mule-resource/js/mule.js"></script>
<script type="text/javascript">
function init()
{
mule.subscribe("/mule/notifications", notif);
}
<flow name="httpProxyFlow">
<http:inbound-endpoint address="http://localhost:8081/foo/profile/user" exchange-pattern="request-response"/>
<http:outbound-endpoint
address="http://foo.com/url/#[groovy:message.getInboundProperty('http.request').split('/foo/profile/user')[1]]"/>
</flow>
#Updated at Wed Oct 26 20:47:36 EDT 2011
#Wed Oct 26 20:47:36 EDT 2011
log4j.rootLogger=error, stdout
log4j.appender.R.File=application.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
@johndemic
johndemic / gist:2003703
Created March 8, 2012 21:54
Order Update Consumption with AMQP and PHP
$cnn = new AMQPConnection();
$cnn->connect();
// Create a channel
$ch = new AMQPChannel($cnn);
// Declare the events-exchange
$ex = new AMQPExchange($ch);
$ex->setName("events-exchange");
$ex->setType(AMQP_EX_TYPE_TOPIC);
@johndemic
johndemic / gist:2003654
Created March 8, 2012 21:42
Submitting an Order to an AMQP Exchange with PHP
$cnn = new AMQPConnection();
$cnn->connect();
// Create a channel
$ch = new AMQPChannel($cnn);
// Declare the orders-exchange
$ex = new AMQPExchange($ch);
$ex->setName("orders-exchange");
$ex->setType(AMQP_EX_TYPE_DIRECT);
@johndemic
johndemic / gist:2003610
Created March 8, 2012 21:31
Order Submission Flow
<flow name="order.submission">
<amqp:inbound-endpoint
exchangeName="orders-exchange"
exchangeType="direct"
exchangeAutoDelete="false"
exchangeDurable="true"
queueName="order-submission"
queueDurable="true"
queueExclusive="true"
queueAutoDelete="false"