最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Kafka gives me an error while trying to send manual message - Stack Overflow

programmeradmin4浏览0评论

I am sending message kafka to manually. This is the sent message:

`"{\"quote\":{\"customerOrderId\":12345,\"quoteChars\":[{\"valueList\":[{\"shortCode\":\"ExampleName1\"}]}],\"quotePriceDetail\":{\"total\":100.0},\"paymentInformation\":{\"billingAccount\":{\"accountId\":67890},\"chargedAmount\":100.0,\"paymentStatus\":\"PAID\"},\"offerInstances\":[{\"productKey\":{\"productId\":11111},\"transferredProductKey\":{\"productId\":66666},\"productOfferId\":33333,\"productChars\":[{\"charShortCode\":\"loyaltyInstance\",\"charValue\":\"true\"}],\"actionCode\":\"ACTIVATION\"},{\"productKey\":{\"productId\":66666},\"transferredProductKey\":{\"productId\":11111},\"productOfferId\":88888,\"productChars\":[{\"charShortCode\":\"loyaltyInstance\",\"charValue\":\"true\"}],\"actionCode\":\"DEACTIVATION\"}],\"customer\":{\"id\":55555},\"businessInteraction\":{\"businessInteractionSpecShortCode\":\"NEW_SALE\"},\"businessFlowSpecShortCode\":\"DeviceChange\"},\"salesOrderOperationType\":\"SUCCESS\"}"`

And this is the header:

`{"messageType":"QuoteEvent","X-User-Context":"{\"crmUserId\":38850,\"idpUserId\":\"9e1b0955-4de6-47a9-bb4a-dfade12cadb2\",\"employeeId\":90099991111,\"name\":\"csr1 csr1\",\"userSaleChannelId\":4,\"credentialTypeCode\":\"credentialTpCode\",\"credentialInvolvementTypeCode\":\"credentialInvlTpCode\",\"userRoles\":[{\"id\":100004,\"code\":\"CSR\",\"authority\":\"CSR\"},{\"id\":63,\"code\":\"domainSpec\",\"authority\":\"domainSpec\"},{\"id\":1000,\"code\":\"CLIENT_ADMIN\",\"authority\":\"CLIENT_ADMIN\"},{\"id\":100501,\"code\":\"userManager\",\"authority\":\"userManager\"},{\"id\":60,\"code\":\"pcmManager\",\"authority\":\"pcmManager\"},{\"id\":100002,\"code\":\"CUST\",\"authority\":\"CUST\"},{\"id\":4,\"code\":\"csrAgent\",\"authority\":\"csrAgent\"},{\"id\":200004,\"code\":\"technicalPermission\",\"authority\":\"technicalPermission\"},{\"id\":62,\"code\":\"domainManager\",\"authority\":\"domainManager\"},{\"id\":100000,\"code\":\"ADMIN\",\"authority\":\"ADMIN\"},{\"id\":200002,\"code\":\"fullPermission\",\"authority\":\"fullPermission\"},{\"id\":100021,\"code\":\"posCsr\",\"authority\":\"posCsr\"}],\"enabled\":false,\"anonymousUser\":false,\"customerFraud\":false,\"accountNonExpired\":false,\"accountNonLocked\":false,\"credentialsNonExpired\":false,\"clientCredentials\":false}","__TypeId__":"java.lang.String"}`

And I get following error code:

`2025-03-12T13:48:12.613+03:00  INFO 1 --- [bstp-loyalty-integrator] [ss.mc.cpq-0-C-1] [                                                 ] c.e.b.l.b.e.d.s.impl.EcaServiceImpl      : exception getting token , e : No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.`

When I inspect the code I find error while connection to this endpoint :

:8290/external-rest/loyalty/1.0/submitLoyalty

And this is the code where request sent:

`webClient.post()
                .uri(domainConfigService.generateServiceUrl(SystemTypes.LOYALTY.getCode(), WebServiceTypes.REGISTER.getCode()))
                .body(Mono.just(loyaltyRegisterRequest), LoyaltyRegisterRequest.class)
                .headers(loyaltyWebClientHeader.defaultHeaders())
                .retrieve()
                .onStatus(HttpStatusCode::isError, res -> WebClientRetrieveErrorHandler.handle(ApiNames.REGISTER.getName(), res))
                .toBodilessEntity()
                .doOnSuccess(response -> WebClientRetrieveLogger.logSuccess(ApiNames.REGISTER.getName(), response.getStatusCode()))
                .block();`
发布评论

评论列表(0)

  1. 暂无评论