Skip to content

Instantly share code, notes, and snippets.

View dangnhdev's full-sized avatar

Nguyễn Hải Đăng dangnhdev

  • Hanoi, Vietnam
View GitHub Profile
import org.dangnh.xmlconfig.annotation.*;
/**
*
* @author DangNH
*/
@Source("file:./config/RMQConfig.xml")
public interface RmqConnectionConfig{
@Key("rmq-config.connection.host")
import org.dangnh.xmlconfig.annotation.*;
/**
*
* @author DangNH
*/
@Source("file:./config/RMQConfig.xml") /*URI đến file config*/
public interface RmqExchangeDeclareConfig{
@Key("rmq-config.consumer.exchange-declare")
@DefaultValue("tms-topic") /*giá trị mặc định*/
import com.elcom.ifccore.config.RmqExchangeDeclareConfig;
import org.dangnh.xmlconfig.ConfigFactory;
/**
*
* @author DangNH
*/
public class TestConfig {
public static void main(String[] args) {
RmqExchangeDeclareConfig config = ConfigFactory.create(RmqExchangeDeclareConfig.class);
import java.lang.reflect.Method;
import org.dangnh.xmlconfig.Converter.Converter;
/**
*
* @author DangNH
*/
public class CustomCvt implements Converter{
@Override
import org.dangnh.xmlconfig.annotation.*;
/**
*
* @author DangNH
*/
@Source("file:./config/RMQConfig.xml")
public interface RmqConsumerConfig {
@CustomConverter(CustomCvt.class)
@Key("rmq-config.consumer.pool-size")
public class TestMsgListener implements MsgHandler {
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestMsgListener.class);
@Override
public void OnRecvMsg(MessageProtocol.Message msg) {
System.out.println("asdasdda");
}
}
import java.util.HashSet;
import java.util.Set;
/**
* Created by dangg on 5/19/2016.
*/
class HashSetOrderingTest {
public static void main(String args[]) {
Set<String> hset = new HashSet<String>();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!-- ===================================================================== -->
<!-- Log4j Configuration -->
<!-- ===================================================================== -->
<!--
| For more configuration infromation and examples see the Jakarta Log4j
| owebsite: http://jakarta.apache.org/log4j
-->
import java.util.LinkedList;
import java.util.Queue;
/**
*
* @author 404NotFound
*/
public class MyQueue<E> {
private final Object sync = new Object();
import rx.Observable;
import rx.observables.ConnectableObservable;
import rx.subjects.BehaviorSubject;
import java.util.concurrent.TimeUnit;
/**
* Created by dangg on 6/13/2016.
*/
public class MainTest {