60 Commity 60fceb7506 ... ef5ba788a7

Autor SHA1 Wiadomość Data
  liutong3 ef5ba788a7 Merge branch 'master' of http://10.1.235.20:3000/rest/rest-guide 6 lat temu
  liutong3 f3aa8d34c9 增加rabbitmq的消费者、生产者代码 6 lat temu
  liutong3 054c7af470 Merge branch 'master' of http://10.1.235.20:3000/rest/rest-guide 6 lat temu
  liutong3 e6ebab4a15 重装zk,配置信息有变化 6 lat temu
  liutong3 c2df84bca8 Merge branch 'master' of http://10.1.235.20:3000/rest/rest-guide 6 lat temu
  liutong3 b73972457b zk改成使用ipu-zk连接 6 lat temu
  liutong3 1c8cbafb8f rocketMQ示例 6 lat temu
  liutong3 afeb47976f kafka示例 6 lat temu
  liutong3 0c878383ab zookeeper示例 6 lat temu
  huangbo da13ffafd9 增加异常编码,增加上下文操作。 6 lat temu
  huangbo e365aa7af3 完成文件上传范例的初始版本,支持单个文件和多个文件上传。 6 lat temu
  huangbo 9671698074 全局异常优化:自定义异常和默认异常处理 6 lat temu
  huangbo 0b845642d9 增加校验切面、权限切面、事务切面三类切面 6 lat temu
  huangbo 47541f520d JMap和IData的自定义适配从配置文件迁移至代码中 6 lat temu
  huangbo 2c1d65c096 pom的BUG修复、优化 6 lat temu
  huangbo e0e46714fb comp-example工程初始化 6 lat temu
  huangbo c6bb31dad1 版本变更:3.1-SNAPSHOT 6 lat temu
  huangbo 5a81f339f0 层级化打包pom代码优化 6 lat temu
  huangbo 4a741177e4 重要:jar分离打包方案初始版本 6 lat temu
  huangbo 1cc0e6568c pom优化微调 6 lat temu
  huangbo 7da3c05382 pom结构微调 6 lat temu
  huangbo 5ee7e43074 引入druid组件 6 lat temu
  huangbo 0191dd254f 新功能改造:Controller参数支持JMap 6 lat temu
  huangbo fc694e8d6d 代码优化 6 lat temu
  huangbo b4db991651 优化IpuContextData上下文对象逻辑处理。 6 lat temu
  huangbo 3b96f790d8 优化:修改配置 6 lat temu
  huangbo 8414a0f6ad 增加文件上传的代码,还有BUG。 6 lat temu
  huangbo 473c0ab28e 开发dubbo公用调用方法callCommonService 6 lat temu
  huangbo 4f5997c2ab 在rest和service体系下增加dubbo调用方式 6 lat temu
  huangbo 679cbfb5f2 IpuController下沉 6 lat temu
  huangbo c8be4f8358 提交lic 6 lat temu
  huangbo 1fca57cd0e IPU服务端脚手架工程初始化 6 lat temu
  huangbo fcbb66cac1 优化 6 lat temu
  huangbo 0b5e503a7c 增加单表增删改查的范例 6 lat temu
  miaozy 6b9ee44935 删除aif内网私服地址 7 lat temu
  miaozy 9a92966bb5 引入msgframe相关依赖包 7 lat temu
  huangbo 7039cfabfd 引入msgframe的Demo使用案例 7 lat temu
  huangbo 9ece25612e 区分context-path、servlet-path、static-path,正确配置拦截器的exclude-mapping 7 lat temu
  huangbo 0e0419f4c0 Merge branch 'master' of http://10.1.235.20:3000/rest/rest-guide.git 7 lat temu
  huangbo 2feb78415e 引入IPU MCV体系。结合spring mvc共同使用。 7 lat temu
  huangbo ed04772fc2 在过滤器上增加数据库统一管理的功能和对应案例 7 lat temu
  huangbo 27d4ec055f 日志适配、增加线程栈自动dump配置、增加Netty4通信 7 lat temu
  huangbo afcceedf91 增加令牌验证案例 7 lat temu
  huangbo 277716a327 增加延迟连接lazy="true" 7 lat temu
  huangbo 8f10c195a5 增加服务并发控制案例 7 lat temu
  huangbo ebfd0f4f5e 增加服务伪装案例 7 lat temu
  huangbo 67375cbb3d 增加服务存根案例 7 lat temu
  huangbo 0a4bf8791b 修复dubbo的oninvoke属性bug,修改了DubboBeanDefinitionParser和FutureFilter 7 lat temu
  huangbo 4e73226787 dubbo拦截器案例 7 lat temu
  huangbo a31e945d23 dubbo拦截器案例 7 lat temu
  huangbo 80381cd8a0 服务回调案例 7 lat temu
  huangbo 0189ab35d2 案例工程代码结构调整 7 lat temu
  huangbo 0f4c2f4104 修改readme,说明ipu license。 7 lat temu
  huangbo 1f85105a33 提交ipu license证书 7 lat temu
  huangbo 7ae2e05013 固定的数据接口返回格式:返回信息、返回编码、返回异常。 7 lat temu
  huangbo 509c3cca74 pom优化,正式和测试环境优化。 7 lat temu
  huangbo 9096fb8b98 开发、测试、正式环境的区分 7 lat temu
  huangbo e17c2812aa 代码调整和优化 7 lat temu
  huangbo 3c08dfb933 rest向导工程初始化 7 lat temu
  rest 6d6df65ecb initial commit 7 lat temu

+ 6 - 0
comp-example/pom.xml

@ -54,6 +54,12 @@
54 54
		</dependency>
55 55
56 56
		<dependency>
57
			<groupId>com.rabbitmq</groupId>
58
			<artifactId>amqp-client</artifactId>
59
			<version>3.6.5</version>
60
		</dependency>
61
62
		<dependency>
57 63
			<groupId>com.ai.ipu</groupId>
58 64
			<artifactId>ipu-zk</artifactId>
59 65
			<version>${ipu}</version>

+ 45 - 0
comp-example/src/test/java/com/ai/ipu/example/rabbitmq/RabbitMQCustomerExample.java

@ -0,0 +1,45 @@
1
package com.ai.ipu.example.rabbitmq;
2
3
import com.rabbitmq.client.*;
4
5
import java.io.IOException;
6
import java.util.concurrent.TimeoutException;
7
8
/**
9
 * @author liutong3
10
 * @team IPU
11
 * @date 2019/5/28 11:00
12
 * @desc rabbitmq消费者
13
 */
14
public class RabbitMQCustomerExample {
15
    private final static String QUEUE_NAME = "rabbitMQ.test";
16
17
    public static void main(String[] args) throws IOException, TimeoutException {
18
        // 创建连接工厂
19
        ConnectionFactory factory = new ConnectionFactory();
20
        //设置RabbitMQ地址
21
        factory.setHost("47.105.160.21");
22
        factory.setUsername("admin");
23
        factory.setPassword("admin");
24
        //创建一个新的连接
25
        Connection connection = factory.newConnection();
26
        //创建一个通道
27
        Channel channel = connection.createChannel();
28
        //声明要关注的队列
29
        channel.queueDeclare(QUEUE_NAME, false, false, true, null);
30
        //DefaultConsumer类实现了Consumer接口,通过传入一个频道,
31
        // 告诉服务器我们需要那个频道的消息,如果频道中有消息,就会执行回调函数handleDelivery
32
        Consumer consumer = new DefaultConsumer(channel) {
33
            @Override
34
            public void handleDelivery(String consumerTag, Envelope envelope,
35
                                       AMQP.BasicProperties properties, byte[] body)
36
                    throws IOException {
37
                String message = new String(body, "UTF-8");
38
                System.out.println("返回消息信息:");
39
                System.out.println(message);
40
            }
41
        };
42
        //自动回复队列应答 -- RabbitMQ中的消息确认机制
43
        channel.basicConsume(QUEUE_NAME, true, consumer);
44
    }
45
}

+ 50 - 0
comp-example/src/test/java/com/ai/ipu/example/rabbitmq/RabbitMQProducerExample.java

@ -0,0 +1,50 @@
1
package com.ai.ipu.example.rabbitmq;
2
3
import com.rabbitmq.client.Channel;
4
import com.rabbitmq.client.Connection;
5
import com.rabbitmq.client.ConnectionFactory;
6
import org.apache.kafka.clients.producer.ProducerRecord;
7
8
import java.io.IOException;
9
import java.util.Scanner;
10
import java.util.concurrent.TimeoutException;
11
12
/**
13
 * @author liutong3
14
 * @team IPU
15
 * @date 2019/5/28 11:02
16
 * @desc tabbitmq生产者
17
 */
18
public class RabbitMQProducerExample {
19
    public final static String QUEUE_NAME="rabbitMQ.test";
20
21
    public static void main(String[] args) throws IOException, TimeoutException {
22
        //创建连接工厂
23
        ConnectionFactory factory = new ConnectionFactory();
24
        //设置RabbitMQ相关信息
25
        factory.setHost("47.105.160.21");
26
        factory.setUsername("admin");
27
        factory.setPassword("admin");
28
//        factory.setPort();
29
        //创建一个新的连接
30
        Connection connection = factory.newConnection();
31
        //创建一个通道
32
        Channel channel = connection.createChannel();
33
        //  声明一个队列        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
34
        try {
35
            Scanner sc = new Scanner(System.in);
36
            int i = 0;
37
            while (true) {
38
                i++;
39
                System.out.println("请输入第" + i + "条信息的内容:");
40
                String message = sc.nextLine();
41
                channel.basicPublish("", QUEUE_NAME, null, message.getBytes("UTF-8"));
42
                System.out.println("Sent:" + message);
43
            }
44
        } finally {
45
            //关闭通道和连接
46
            channel.close();
47
            connection.close();
48
        }
49
    }
50
}