试图使用
val nullablestr = hornetQMessage.getBodyBuffer.readNullableSimpleString.toString
或者
val strMessage = hornetQMessage.getBodyBuffer.readString
得到
java.lang.NegativeArraySizeException at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readSimpleStringInternal(ChannelBufferWrapper.java:83) at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readNullableSimpleString(ChannelBufferWrapper.java:58) at com。 gamescale.messaging.hornetQ.HornetQMessageConverter$.extractGSMessage(HornetQMessageConverter.scala:68) at com.gamescale.messaging.hornetQ.MessageBusHornetQClientImpl$$anonfun$1$$anon$2$$anonfun$receive$1.apply(MessageBusHornetQClientImpl.scala:246) at com.gamescale.messaging.hornetQ.MessageBusHornetQClientImpl$$anonfun$1$$anon$2$$anonfun$receive$1.apply(MessageBusHornetQClientImpl.scala:243) at akka.actor.Actor$class.apply(Actor.scala:563)在 com.gamescale.messaging.hornetQ.MessageBusHornetQClientImpl$$anonfun$1$$anon$2.apply(MessageBusHornetQClientImpl.scala:242) at akka.actor.LocalActorRef.invoke(ActorRef.scala:905) at akka.dispatch.MessageInvocation.invoke(MessageHandling.scala:25) at akka.dispatch.ExecutableMailbox$class.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:216) at akka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.processMailbox(ExecutorBasedEventDrivenDispatcher.scala:122) at akka.dispatch.ExecutableMailbox$class.run(ExecutorBasedEventDrivenDispatcher.scala:188) atakka.dispatch.ExecutorBasedEventDrivenDispatcher$$anon$4.run(ExecutorBasedEventDrivenDispatcher. scala:122) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 在 java.lang.Thread.run(Thread .java:722) 在 akka.dispatch.MonitorableThread.run(ThreadPoolBuilder.标量:184)
我正在使用相同的方法来编写消息
hornetQMessage.getBodyBuffer.writeString(message)
有任何想法吗 ?