Skip to content

Instantly share code, notes, and snippets.

mvn archetype:generate -DgroupId=com.javacodegeeks -DartifactId=SampleApplication -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
--[[
RATELIMIT LUA script does the following :
1. Increments counter for the supplied bucket.
2. Deletes the subsequent buckets.
3. Renews expiry time for the subjectKey
KEYS[1]: subject's key
ARGV[1]: bucket number
ARGV[2]: subject expiry in seconds
ARGV[3]: buckets to clear ahead
@hpirosha
hpirosha / high-level-consumer.log
Created January 16, 2014 15:02
Using high level consumer from Kafka 0.8.0 distribution. There are two kafka and single zookeeper node.
2014-01-16 20:29:08:228 [INFO ] [main] [TestKafkaConsumer] - Zookeeper url :192.168.64.210:2181
2014-01-16 20:29:08:403 [INFO ] [main] [VerifiableProperties] - Verifying properties
2014-01-16 20:29:08:428 [INFO ] [main] [VerifiableProperties] - Property auto.commit.interval.ms is overridden to 6000
2014-01-16 20:29:08:428 [INFO ] [main] [VerifiableProperties] - Property group.id is overridden to consumer.group.1
2014-01-16 20:29:08:428 [INFO ] [main] [VerifiableProperties] - Property zookeeper.connect is overridden to 192.168.64.210:2181
2014-01-16 20:29:08:428 [INFO ] [main] [VerifiableProperties] - Property zookeeper.session.timeout.ms is overridden to 10000
2014-01-16 20:29:08:429 [INFO ] [main] [VerifiableProperties] - Property fetch.wait.max.ms is overridden to 100
2014-01-16 20:29:08:429 [INFO ] [main] [VerifiableProperties] - Property consumer.timeout.ms is overridden to 100
2014-01-16 20:29:08:465 [INFO ] [main] [ZookeeperConsumerConnector] - [consumer.group.1_Impetus-L292-1389884348463-3e0deb32], Con
@hpirosha
hpirosha / SpringCamelMain.java
Created December 4, 2012 12:53
demoOne_camel_spring_main
package org.nsinfra.camel;
import org.apache.camel.spring.Main;
public class SpringCamelMain {
public static void main(String[] args) throws Exception {
/**
* Loads spring application context files kept under
* META-INF/spring folder placed in CLASSPATH
@hpirosha
hpirosha / applicationContext.xml
Created December 4, 2012 12:50
demoOne_camel_spring
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.10.1.xsd">
<camelContext id="demoCamelContext" xmlns="http://camel.apache.org/schema/spring">
<route id="demoCBRRoute">
<from
uri="activemq:queue:NewOrders?brokerURL=tcp://192.168.64.144:61616" />
@hpirosha
hpirosha / JavaDSLMain
Created December 4, 2012 11:53
demoOne_camel_java_dsl
package org.nsinfra.camel;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class JavaDSLMain extends RouteBuilder {
/**
* {@link RouteBuilder#configure()}
@hpirosha
hpirosha / pom.xml
Created December 4, 2012 11:12
apache_camel_demo_one
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.nsinfra</groupId>
<artifactId>demoOne</artifactId>
<packaging>jar</packaging>
<version>1.0</version>