Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: balances-api
description: Retrieve account balances
spec:
type: openapi
lifecycle: production
owner: acmefinancial
system: acme-engagement-portal
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd">
@johndemic
johndemic / broker.drl
Created February 6, 2012 21:52
Mule Drools CEP Example
package org.drools.examples.broker
import org.mule.MessageExchangePattern;
import org.mule.example.cep.Company
import org.mule.example.cep.StockTick
global org.mule.module.bpm.MessageService mule;
# default dialect for the semantic code will be MVEL
dialect "mvel"
/**
* Mule Development Kit
* Copyright 2010-2011 (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@johndemic
johndemic / cassandra-idempotent-config.xml
Created September 24, 2013 15:53
An example of using the CassandraDbObjectStore to distribute the state of an idempotent-message-filter.
<spring:bean id="cassandraObjectStore" class="com.mulesoft.mule.cassandradb.CassandraDBObjectStore"
scope="singleton">
<spring:property name="host" value="cassandradb.acmesoft.com"/>
<spring:property name="port" value="9160"/>
<spring:property name="keyspace" value="MuleState"/>
<spring:property name="consistencyLevel" value="ALL"/>
<spring:property name="defaultPartitionName"
value="idempotentFlow_#[new java.text.SimpleDateFormat('yyyy_MM_dd').format(new Date())]"/>
</spring:bean>
@BeforeClass
public static void installLicense() throws Exception {
LicenseManager licenseManager = LicenseManagementFactory.getInstance()
.createLicenseManager(LicenseManagementFactory.MULE_EE);
MuleLicenseKey license = new MuleLicenseKey();
license.setLicenseKeyFile(MyFunctionalTestCase.class
.getResource("/test.lic").getPath());
licenseManager.install(license);
}
/*
* $Id: UntilSuccessful.java 24377 2012-05-21 12:35:37Z pablo.kraan $
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
/**
* Execute a JPA query. If the payload of the message is a <code>List</code> or <code>Map</code> then its used
* as the query parameters. If neither statement nor namedQuery are set then the payload of the message is assumed
* to be a <code>CriteriaQuery</code> instance.
* <p/>
* {@sample.xml ../../../doc/JPAModule-connector.xml.sample jpa:query}
*
* @param statement a JPA QL statement to execute
* @param namedQuery a named query to execute
* @param queryParameters the query parameters
- (IBAction)storePassword:(id)sender
{
NSString *service = [NSString stringWithFormat:@"%@@%@", [username stringValue], [address stringValue]];
if ([SSKeychain passwordForService:service account:@"KH"] != nil) {
NSError *error = nil;
if ([SSKeychain deletePasswordForService:service account:@"KH" error:&error] == NO) {
NSLog(@"Could not delete existing password");
}
@johndemic
johndemic / gist:3916048
Created October 19, 2012 03:20
StockQuoteRequestClient
StockQuoteRequest stockQuoteRequest = new StockQuoteRequest();
stockQuoteRequest.setSymbol("FB");
stockQuoteRequest.setStartDate(new Date( new Date().getTime() - (86400000 * 7)));
stockQuoteRequest.setEndDate(new Date());
ZMQ.Socket zmqSocket = zmqContext.socket(ZMQ.REQ);
zmqSocket.setReceiveTimeOut(RECEIVE_TIMEOUT);
zmqSocket.connect("tcp://localhost:9090");
zmqSocket.send(stockQuoteRequest.toProtocolBufferAsBytes(), 0);