spring-cloud / spring-cloud-bus

Spring Cloud event bus
http://cloud.spring.io/spring-cloud-bus/
Apache License 2.0
409 stars 242 forks source link

auto refresh configuration doesn't work when i use github webhook #152

Closed yanglikun closed 4 years ago

yanglikun commented 5 years ago

spring boot version:2.1.3.RELEASE spring cloud version:Greenwich.RELEASE

In my computer,after I access the URL:http://127.0.0.1:8080/actuator/bus-refresh,the configuration can auto refresh.

when I use github webhook,It seems that spring can't parse the github payload. image the response is: {"timestamp":"2019-03-10T04:47:52.685+0000","status":400,"error":"Bad Request","message":"JSON parse error: Cannot deserialize instance ofjava.lang.Stringout of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.lang.Stringout of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 301] (through reference chain: java.util.LinkedHashMap[\"commits\"])","path":"/actuator/bus-refresh"}

I saw the '/actuator/monitor' url in other answers,Though the response is 200 ,but the configuration is not refresh.

spencergibb commented 5 years ago

Can you try with Greenwich.SR1?

yanglikun commented 5 years ago

Can you try with Greenwich.SR1?

The Greenwich.SR1 version does not work either, the error message is the same. It seems that spring can't parse the github payload. The backend log is as follows: 2019-03-20 11:19:50.383|||http-nio-8080-exec-5|WARN |o.s.w.s.m.s.DefaultHandlerExceptionResolver[AbstractHandlerExceptionResolver.java:197]|Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance ofjava.lang.Stringout of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance ofjava.lang.Stringout of START_ARRAY token at [Source: (PushbackInputStream); line: 1, column: 301] (through reference chain: java.util.LinkedHashMap["commits"])]

spencergibb commented 4 years ago

github webhook should point to /monitor not /bus-refresh

Xiaotian0626 commented 2 years ago

大哥,你的问题最后是怎么解决的?我也遇到一样的问题。