# intellimessage **Repository Path**: favccxx/intellimessage ## Basic Information - **Project Name**: intellimessage - **Description**: Intelli Message是基于Apache Camel实现的企业消息转发与处理服务. - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 7 - **Forks**: 2 - **Created**: 2020-11-05 - **Last Updated**: 2025-07-05 ## Categories & Tags **Categories**: message-server **Tags**: None ## README # Intelli message Intelli Message是基于Apache Camel实现的企业消息转发与处理服务,目前已支持常用的Kafka消息协议与ANMQP消息协议。 ## 安装环境 * JAVA 8 及以上 * Maven 3.0.0 或更新 * MongoDB 3.x ## 应用组件 * SpringBoot 2.3.4 * Camel 2.25.2 * Jackson 2.11.3 ## 使用教程 1. 录入消息队列的服务器配置信息 用户通过 http://127.0.0.1:9999/api/v1/msg 消息队列服务器的配置信息. 本服务不支持消息队列采用同一组件在相同地址进行转发,故示例下面的路由采用了AMQP组件与RabbitMQ组件 ``` MongoDB /* 1 */ { "_id" : ObjectId("5f979080c5419a018f3b86c6"), "virtualHost" : "/", "code" : "fromcode", "duribility" : true, "exchangeName" : "fromexchange", "routingName" : "fromrouting", "messageType" : "TOPIC", "queueName" : "fromqueue", "autoDelete" : false, "url" : "172.17.3.100", "port" : 5672, "username" : "guest", "password" : "guest", "version" : "3.8.8", "type" : "AMQP", "createTime" : ISODate("2020-10-27T03:14:08.061Z"), "updateTime" : ISODate("2020-10-27T03:14:08.061Z"), "_class" : "com.favccxx.message.domain.message.entity.endpoint.AmqpEndPoint" } /* 2 */ { "_id" : ObjectId("5f979092c5419a018f3b86c7"), "virtualHost" : "/", "duribility" : true, "code" : "tocode", "exchangeName" : "toexchange", "routingName" : "torouting", "messageType" : "TOPIC", "queueName" : "toqueue", "autoDelete" : false, "url" : "172.17.3.100", "port" : 5672, "username" : "guest", "password" : "guest", "version" : "3.8.8", "type" : "RabbitMQ", "createTime" : ISODate("2020-10-27T03:14:26.483Z"), "updateTime" : ISODate("2020-10-27T03:14:26.483Z"), "_class" : "com.favccxx.message.domain.message.entity.endpoint.RabbitmqEndPoint" } ``` 2. 配置消息路由 消息处理器支持消息的数据名称及类型进行转换,并进行适当的处理,详见源代码。 ``` MongoDB { "_id" : ObjectId("5f9790d6c5419a018f3b86c8"), "routerName" : "cxtestrouter", "fromEndPoint" : "5f979080c5419a018f3b86c6", "messageFormat" : "JSON", "filterInstance" : "", "preprocessor" : "", "persistence" : false, "processor" : "EntityMessageProcessor", "processRules" : "{\"level\":\"PROCESS\",\"name\":\"TargetEntity\",\"rules\":[{\"sourceType\":\"String\",\"sourceExpression\":\"$.dateTime\",\"targetName\":\"sendTime\",\"targetType\":\"String\",\"targetDefaultValue\":\"Analog\"},{\"sourceType\":\"String\",\"sourceExpression\":\"$.data.*.id\",\"targetName\":\"myId\",\"targetType\":\"String\",\"targetDefaultValue\":\"hello\"},{\"sourceType\":\"String\",\"sourceExpression\":\"$.data.*.type\",\"targetName\":\"myType\",\"targetType\":\"String\",\"targetDefaultValue\":\"helloType\"},{\"sourceType\":\"String\",\"sourceExpression\":\"$.data.*.value\",\"targetName\":\"myValue\",\"targetType\":\"String\",\"targetDefaultValue\":\"helloValue\"}]}", "toEndPoint" : "5f979092c5419a018f3b86c7", "status" : true, "createTime" : ISODate("2020-10-27T03:15:34.608Z"), "updateTime" : ISODate("2020-10-28T10:32:23.030Z"), "_class" : "com.favccxx.message.domain.message.entity.router.MessageRouter" } ``` 3. 消息示例 源消息内容如下: ``` { "dateTime": "2020-10-21 11:59:42", "data": [ { "id": "36341", "value": "0", "type": "Analog" }, { "id": "36343", "value": "0", "type": "Analog" }] } ``` 转发后消息如下: ``` { "name": "TargetEntity", "dataMap": [ { "myId": "36341", "myType": "Analog", "myValue": "0", "sendTime": "2020-10-21 11:59:42" }, { "myId": "36343", "myType": "Analog", "myValue": "0", "sendTime": "2020-10-21 11:59:42" } ] } ``` ## 使用许可 本项目采用 [想怎么用就怎么用]() 许可,请务必严格遵循其规范。