浏览代码

Merge branch 'master' of http://10.1.235.20:3000/rest/code-example.git

huangbo 5 年之前
父节点
当前提交
975024b72d

+ 30 - 0
ipu-db-example/pom.xml

@ -0,0 +1,30 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0"
3
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
    <modelVersion>4.0.0</modelVersion>
6
7
    <groupId>com.ai.ipu</groupId>
8
    <artifactId>ipu-db-example</artifactId>
9
    <version>1.0-SNAPSHOT</version>
10
11
    <properties>
12
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13
        <ipu>3.1-SNAPSHOT</ipu>
14
        <jdk>1.8</jdk>
15
    </properties>
16
17
    <dependencies>
18
        <dependency>
19
            <groupId>com.ai.ipu</groupId>
20
            <artifactId>ipu-database</artifactId>
21
            <version>${ipu}</version>
22
        </dependency>
23
        <dependency>
24
            <groupId>com.ai.ipu</groupId>
25
            <artifactId>ipu-sql-mgmt</artifactId>
26
            <version>${ipu}</version>
27
        </dependency>
28
    </dependencies>
29
30
</project>

+ 5 - 1
ipu-kafka-example/src/main/java/com/ai/ipu/example/kafka/KafkaCustomer.java

@ -1,5 +1,6 @@
1 1
package com.ai.ipu.example.kafka;
2 2
3
import com.ai.aif.msgframe.consumer.MfConsumerClient;
3 4
import com.ai.aif.msgframe.consumer.MfServiceStartup;
4 5
5 6
/**
@ -10,6 +11,9 @@ import com.ai.aif.msgframe.consumer.MfServiceStartup;
10 11
 */
11 12
public class KafkaCustomer {
12 13
    public static void main(String[] args){
13
        MfServiceStartup.main();
14
        //全部启动
15
//        MfServiceStartup.main();
16
        //启动某一个topic(还是需要与msgframe-config.xml中对应)
17
        MfConsumerClient.subscribe("test", "*",	"com.ai.ipu.example.kafka.KafkaCustomerExample");
14 18
    }
15 19
}

+ 0 - 6
ipu-kafka-example/src/main/resources/msgframe-config.xml

@ -18,11 +18,5 @@
18 18
                <url>47.105.160.21:9091,47.105.160.21:9092,47.105.160.21:9093</url>
19 19
            </cluster>
20 20
        </clusters>
21
        <!--<persistence>-->
22
            <!--<exceptionPersistence>-->
23
                <!--<producerExceptionClass>com.ai.ipu.example.kafka.exception.ProducerExceprionHandle</producerExceptionClass>-->
24
                <!--<consumerExceptionClass>com.ai.ipu.example.kafka.exception.ConsumerExceprionHandle</consumerExceptionClass>-->
25
            <!--</exceptionPersistence>-->
26
        <!--</persistence>-->
27 21
    </centerCfg>
28 22
</msgframeCfg>