Skip to content

java.lang.NumberFormatException when parsing Long #382

@jinrongluo

Description

@jinrongluo

There are several places in the code which invoking Long.ParseLong() without checking the existence of the Long argument. this will be causing the following exception in the logs

2021-06-07 17:38:13,850 INFO  [ConsumeMessageThread_ConsumerGroup-509db3b0e3d3488287da6ffbcbb9d6ee-FT0_20] EventMeshMessageListenerConcurrently(EventMeshMessageListenerConcurrently.java:62) - handleMessage fail
java.lang.NumberFormatException: null
	at java.lang.Integer.parseInt(Integer.java:542) ~[?:1.8.0_261]
	at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_261]
	at org.apache.eventmesh.runtime.core.protocol.http.consumer.HandleMsgContext.<init>(HandleMsgContext.java:82) ~[eventmesh-runtime-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
	at org.apache.eventmesh.runtime.core.protocol.http.consumer.EventMeshConsumer$1.consume(EventMeshConsumer.java:141) ~[eventmesh-runtime-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
	at org.apache.eventmesh.connector.rocketmq.consumer.PushConsumerImpl$2.handleMessage(PushConsumerImpl.java:167) ~[eventmesh-connector-rocketmq-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
	at org.apache.eventmesh.connector.rocketmq.patch.EventMeshMessageListenerConcurrently.consumeMessage(EventMeshMessageListenerConcurrently.java:46) [eventmesh-connector-rocketmq-1.2.0-SNAPSHOT.jar:1.2.0-SNAPSHOT]
	at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:482) [eventmesh-connector-rocketmq-1.2.0-SNAPSHOT.jar:4.7.1]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_261]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_261]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_261]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_261]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions