v4.6.9版本BUG

This commit is contained in:
yiyan 2019-04-15 22:19:26 +08:00
parent 5728f2f54c
commit 59ccfe59bb
4 changed files with 76 additions and 83 deletions

View File

@ -23,11 +23,11 @@
</dependency> </dependency>
<dependency> <!--<dependency>
<groupId>org.apache.activemq</groupId> <groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId> <artifactId>activemq-all</artifactId>
<version>5.15.4</version> <version>5.15.4</version>
</dependency> </dependency>-->
<dependency> <dependency>
<groupId>org.quartz-scheduler</groupId> <groupId>org.quartz-scheduler</groupId>
@ -174,8 +174,8 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>1.7</source>
<target>1.8</target> <target>1.7</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -1,17 +1,6 @@
package com.ifish.socketNew; package com.ifish.socketNew;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import com.ifish.entity.*; import com.ifish.entity.*;
import com.ifish.socketNew.model.receive.*;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.ifish.enums.BooleanEnum; import com.ifish.enums.BooleanEnum;
import com.ifish.enums.NeteaseEnum; import com.ifish.enums.NeteaseEnum;
import com.ifish.enums.PushTypeEnum; import com.ifish.enums.PushTypeEnum;
@ -20,16 +9,23 @@ import com.ifish.quartz.JobGroup;
import com.ifish.quartz.ScheduleJob; import com.ifish.quartz.ScheduleJob;
import com.ifish.service.DeviceService; import com.ifish.service.DeviceService;
import com.ifish.service.UserService; import com.ifish.service.UserService;
import com.ifish.socketNew.model.send.OrderFunctionCode0; import com.ifish.socketNew.model.receive.BackFunctionCode0;
import com.ifish.socketNew.model.send.OrderFunctionCode1; import com.ifish.socketNew.model.receive.BackFunctionCode1;
import com.ifish.socketNew.model.send.OrderFunctionCode15; import com.ifish.socketNew.model.receive.BackFunctionCode8;
import com.ifish.socketNew.model.send.OrderFunctionCode16; import com.ifish.socketNew.model.receive.BackFunctionCodeHeater;
import com.ifish.socketNew.model.send.OrderFunctionCode17; import com.ifish.socketNew.model.send.*;
import com.ifish.socketNew.model.send.OrderFunctionCode5;
import com.ifish.socketNew.model.send.OrderFunctionCode9;
import com.ifish.socketNew.util.OrderModel; import com.ifish.socketNew.util.OrderModel;
import com.ifish.util.ByteUtil; import com.ifish.util.ByteUtil;
import com.ifish.util.IfishUtil; import com.ifish.util.IfishUtil;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
/** /**

View File

@ -3,14 +3,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:amq="http://activemq.apache.org/schema/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/context/spring-context-4.0.xsd"
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.14.1.xsd"
default-lazy-init="true"> default-lazy-init="true">
<!-- 注册识别注解 --> <!-- 注册识别注解 -->
@ -79,16 +76,16 @@
</constructor-arg> </constructor-arg>
</bean> </bean>
<amq:connectionFactory id="amqConnectionFactory" <!--<amq:connectionFactory id="amqConnectionFactory"
brokerURL="${broker_url}" brokerURL="${broker_url}"
userName="${username}" userName="${username}"
password="${password}" /> password="${password}" />-->
<!-- 配置JMS连接工长 --> <!-- 配置JMS连接工长 -->
<bean id="connectionFactory" <!--<bean id="connectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory"> class="org.springframework.jms.connection.CachingConnectionFactory">
<constructor-arg ref="amqConnectionFactory" /> <constructor-arg ref="amqConnectionFactory" />
<property name="sessionCacheSize" value="100" /> <property name="sessionCacheSize" value="100" />
</bean> </bean>-->
<!--<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> <!--<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/> <property name="connectionFactory" ref="connectionFactory"/>

View File

@ -7,12 +7,12 @@ import com.ifish.util.IfishUtil;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate; //import org.springframework.jms.core.JmsTemplate;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.jms.Destination; //import javax.jms.Destination;
import javax.jms.Session; //import javax.jms.Session;
import java.util.Date; import java.util.Date;
/** /**
@ -21,55 +21,55 @@ import java.util.Date;
* @Date: Created in 16:20 2019-04-10 * @Date: Created in 16:20 2019-04-10
* @Modified by: * @Modified by:
*/ */
@RunWith(SpringJUnit4ClassRunner.class) //@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:application-context.xml") //@ContextConfiguration(locations="classpath:application-context.xml")
public class SomeServerQueueTest { public class SomeServerQueueTest {
@Autowired // @Autowired
private JmsTemplate jmsTemplate; // private JmsTemplate jmsTemplate;
//
@Autowired // @Autowired
private Destination ifish7DataQueueDestination; // private Destination ifish7DataQueueDestination;
@Autowired // @Autowired
private Destination ifish7PushQueueDestination; // private Destination ifish7PushQueueDestination;
//
@Test // @Test
public void testDataMessageSend(){ // public void testDataMessageSend(){
String json = "this's a test message"; // String json = "this's a test message";
JSONObject data = new JSONObject(); // JSONObject data = new JSONObject();
data.put("heaterMacAddress","12345"); // data.put("heaterMacAddress","12345");
data.put("heaterWaterTemperature","130"); // data.put("heaterWaterTemperature","130");
data.put("heaterPh","1200"); // data.put("heaterPh","1200");
data.put("heaterGatheringDate", IfishUtil.format1(new Date())); // data.put("heaterGatheringDate", IfishUtil.format1(new Date()));
data.put("heaterGatheringTime","17"); // data.put("heaterGatheringTime","17");
//
QueueEventEntity eventEntity = new QueueEventEntity(); // QueueEventEntity eventEntity = new QueueEventEntity();
eventEntity.setEventName("com.ifish7.mq.queues.event.IntelligentHeatingRodEvent"); // eventEntity.setEventName("com.ifish7.mq.queues.event.IntelligentHeatingRodEvent");
eventEntity.setEventProcess("intelligentHeatingRodSaveOrUpdate"); // eventEntity.setEventProcess("intelligentHeatingRodSaveOrUpdate");
QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.device.entity.TblDeviceHeater",data); // QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.device.entity.TblDeviceHeater",data);
eventEntity.setEventBody(eventBody); // eventEntity.setEventBody(eventBody);
//
String eventEntityStr = JSONObject.toJSONString(eventEntity); // String eventEntityStr = JSONObject.toJSONString(eventEntity);
jmsTemplate.send(ifish7DataQueueDestination,(Session session) -> session.createTextMessage(eventEntityStr)); // //jmsTemplate.send(ifish7DataQueueDestination,(Session session) -> session.createTextMessage(eventEntityStr));
} // }
//
@Test // @Test
public void testPushMessageSend(){ // public void testPushMessageSend(){
String json = "this's a test message"; // String json = "this's a test message";
JSONObject data = new JSONObject(); // JSONObject data = new JSONObject();
data.put("heaterMacAddress","12345"); // data.put("heaterMacAddress","12345");
data.put("heaterWaterTemperature","130"); // data.put("heaterWaterTemperature","130");
data.put("heaterPh","1200"); // data.put("heaterPh","1200");
data.put("heaterGatheringDate", IfishUtil.format1(new Date())); // data.put("heaterGatheringDate", IfishUtil.format1(new Date()));
data.put("heaterGatheringTime","17"); // data.put("heaterGatheringTime","17");
//
QueueEventEntity eventEntity = new QueueEventEntity(); // QueueEventEntity eventEntity = new QueueEventEntity();
eventEntity.setEventName("com.ifish7.mq.queues.event.IntelligentHeatingRodEvent"); // eventEntity.setEventName("com.ifish7.mq.queues.event.IntelligentHeatingRodEvent");
eventEntity.setEventProcess("intelligentHeatingRodSaveOrUpdate"); // eventEntity.setEventProcess("intelligentHeatingRodSaveOrUpdate");
QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.device.entity.TblDeviceHeater",data); // QueueEventBody eventBody = new QueueEventBody("com.ifish7.mq.business.device.entity.TblDeviceHeater",data);
eventEntity.setEventBody(eventBody); // eventEntity.setEventBody(eventBody);
//
String eventEntityStr = JSONObject.toJSONString(eventEntity); // String eventEntityStr = JSONObject.toJSONString(eventEntity);
//智能加热棒数据更新及保存 // //智能加热棒数据更新及保存
jmsTemplate.send(ifish7PushQueueDestination,(Session session) -> session.createTextMessage(eventEntityStr)); // //jmsTemplate.send(ifish7PushQueueDestination,(Session session) -> session.createTextMessage(eventEntityStr));
} // }
} }