0

试图使用

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)

有任何想法吗 ?

4

1 回答 1

1

作为任何 HornetQ 用户的参考。这个错误的原因是在 HornetQ 论坛上确定的

简而言之,这是由于以错误的顺序从缓冲区中读取值引起的。比如说,你在写字符串之前写了一个负整数,然后在另一边,你尝试在不先读取负整数的情况下读取字符串。

于 2013-06-26T11:57:43.713 回答