|
@@ -305,8 +305,7 @@ public class DataServiceImpl implements IDataService {
|
|
// correlationData.setId("100");
|
|
// correlationData.setId("100");
|
|
//发送到耳标处理消息队列
|
|
//发送到耳标处理消息队列
|
|
//zj+330102002000003+13320241020004+87+0+10+154894+80+20240126174333+1.2#3.0#65535#10794+0+end
|
|
//zj+330102002000003+13320241020004+87+0+10+154894+80+20240126174333+1.2#3.0#65535#10794+0+end
|
|
- int i = eartag.hashCode() %queues;
|
|
|
|
- i = i<0? -i:i ;
|
|
|
|
|
|
+ int i = Math.abs(eartag.hashCode()) % queues;
|
|
log.info("routinKey-->"+Const.ROUTING_KEY_ASK_EARTAG+i);
|
|
log.info("routinKey-->"+Const.ROUTING_KEY_ASK_EARTAG+i);
|
|
rabbitTemplate.convertAndSend(Const.EXCHANGE_ASK_EARTAG, Const.ROUTING_KEY_ASK_EARTAG+i, map);
|
|
rabbitTemplate.convertAndSend(Const.EXCHANGE_ASK_EARTAG, Const.ROUTING_KEY_ASK_EARTAG+i, map);
|
|
// } catch (AmqpTimeoutException e) {
|
|
// } catch (AmqpTimeoutException e) {
|
|
@@ -314,6 +313,15 @@ public class DataServiceImpl implements IDataService {
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String eartag = "13320241020005";
|
|
|
|
+ int i = eartag.hashCode();
|
|
|
|
+ int s = i % 2;
|
|
|
|
+ System.out.println("eartag: " + eartag);
|
|
|
|
+ System.out.println("hashCode: " + i);
|
|
|
|
+ System.out.println("mod 2: " + s); // 直接打印s的值
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public String handleClientAsk_1(String askText) throws ParseException {
|
|
public String handleClientAsk_1(String askText) throws ParseException {
|
|
// System.out.println("000拆分粘包之后数据>>"+askText);
|
|
// System.out.println("000拆分粘包之后数据>>"+askText);
|