Skip to content

Instantly share code, notes, and snippets.

John D'Emic johndemic

Block or report user

Report or block johndemic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5c1eabd77de91a0180b3
org.mule.api.config.ConfigurationException: Line 15 in XML document from URL [file:/Users/john.demic/AnypointStudio/db-batch-messaging/jms-batch-messaging-connector/target/test-classes/jms-batch-messaging-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 15; columnNumber: 19; cvc-complex-type.2.4.a: Invalid content was found starting with element 'jms-batch-messaging:config-type'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.springframework.org/schema/beans":beans, "http://www.springframework.org/schema/beans":bean, "http://www.springframework.org/schema/context":property-placeholder, "http://www.springframework.org/schema/beans":ref, "http://www.mulesoft.org/schema/mule/core":global-property, "http://www.mulesoft.org/schema/mule/core":configuration, "http://www.mulesoft.org/schema/mule/core":notifications, "http://www.mulesoft.org/schema/mule/core":abstract-extension, "http://www.mules
View keybase.md

Keybase proof

I hereby claim:

  • I am johndemic on github.
  • I am johndemic (https://keybase.io/johndemic) on keybase.
  • I have a public key whose fingerprint is 1393 7573 A9F1 9E89 D4B0 EEF3 07BE 3A45 D0DA 31FE

To claim this, I am signing this object:

@johndemic
johndemic / cassandra-idempotent-config.xml
Created Sep 24, 2013
An example of using the CassandraDbObjectStore to distribute the state of an idempotent-message-filter.
View cassandra-idempotent-config.xml
<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>
View MuleLicenseFunctionalTest.java
@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);
}
View RootCausePreservingUntilSuccessful.java
/*
* $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.
*/
View gist:4532336
/**
* 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
View gist:3925465
- (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 Oct 19, 2012
StockQuoteRequestClient
View gist:3916048
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);
View gist:3916027
<flow name="main">
<zeromq:inbound-endpoint address="tcp://*:9090" socket-operation="bind"
exchange-pattern="request-response"/>
<protobuf:deserialize
protobufClass="com.acmesoft.stock.model.serialization.protobuf.StockQuoteRequestBuffer"/>
<expression-transformer
expression="com.acmesoft.stock.model.StockQuoteRequest.fromProtocolBuffer(payload)"/>
<component class="com.acmesoft.stock.service.StockDataServiceImpl"/>
<expression-transformer
expression="return com.acmesoft.stock.model.StockQuote.toProtocolBuffer(payload)"/>
@johndemic
johndemic / gist:3916021
Created Oct 19, 2012
pom.xml with zeromq dependency
View gist:3916021
<dependency>
<groupId>org.zeromq</groupId>
<artifactId>zmq</artifactId>
<version>2.2.0</version>
<systemPath>/usr/local/lib/zmq.jar</systemPath>
<scope>system</scope>
</dependency>
You can’t perform that action at this time.