These are chat archives for spring-cloud/spring-cloud

29th
Jun 2018
Guilherme Blanco
@guilhermeblanco
Jun 29 2018 03:33
If I’m consuming spring-cloud-stream with RabbitMQ binder, by default I have the ApplicationJsonMarshallingMessageConverter. This turns my message into a byte array, but later at submission (inside spring-amqp) it had a SimpleMessageConverter assigned, which overrides the content type from application/json to application/octet-stream (since it conditionally check and assign the content type if the payload is a byte array).
It took me a couple hours to understand the flow, but it seems that in spring-cloud (release train 2.0.3) vanilla install this situation happens
Message goes fine through binder, the payload is the JSON string and we have a headers: contentType: application/json, but a content_type: application/octet-stream
This lead to a break on receiving end, where it looks for a method with a byte[] as argument, instead of my object to be decoded
Where it overrides the ContentType from application/json to application/octet-stream
chetz3
@chetz3
Jun 29 2018 05:15

trying to use spring cloud gateway is there anything i am missing here ?
Error creating bean with name 'gatewayControllerEndpoint'
added deps

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-mvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>

Marcos Barbero
@marcosbarbero
Jun 29 2018 07:24
your dependencies doesn't look good @chetz3
Did you follow this sample? https://github.com/spring-cloud-samples/spring-cloud-gateway-sample
chetz3
@chetz3
Jun 29 2018 07:32
thanks for reply @marcosbarbero the above issue i got the fix .. but the routes which i specified are giving 404 not sure what missed here i am doing properties files based routing
spring:
application:
name: external-gateway-service
cloud:
gateway:
routes:
  - predicates:
      - Path=/inventoryManagement/**
    filters:
      - PrefixPath=/api/v1
    uri: http://localhost:50011
Marcos Barbero
@marcosbarbero
Jun 29 2018 07:34
how your request looks like?
do you have this code in github or some other open repository? It would be way easier to help you out
chetz3
@chetz3
Jun 29 2018 07:38

Actually the repository is not open. it would be great if you try to help me with this or provide me some working samples

https://localhost:8443/api/v1/inventoryManagement/getGroupsAndHostInfo this is my request need it to get routed to localhost:50011

Marcos Barbero
@marcosbarbero
Jun 29 2018 07:42
Enrico Hofmann
@gigo1980_gitlab
Jun 29 2018 13:45
hey together i use the feign client in spring boot 2. how is it possible to use for each feign client his own interceptor
the only thing what i should do is to add the configuration class to the annotation, right ?
KaijuDeluxe
@KaijuDeluxe
Jun 29 2018 15:14
hi how can i consume a rest service which give me XML?