
driven-adapter.rsocket-requester.config.requester-config.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.rsocket.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.codec.cbor.Jackson2CborDecoder;
import org.springframework.http.codec.cbor.Jackson2CborEncoder;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.messaging.rsocket.RSocketStrategies;
@Configuration
public class RequesterConfig {
@Bean
public RSocketRequester rSocketRequester(RSocketStrategies rSocketStrategies) {
RSocketStrategies strategies = RSocketStrategies.builder()
.encoders(encoders -> encoders.add(new Jackson2CborEncoder()))
.decoders(decoders -> decoders.add(new Jackson2CborDecoder()))
.build();
return RSocketRequester.builder()
.rsocketStrategies(strategies)
.dataMimeType(MediaType.APPLICATION_CBOR)
.tcp("localhost",7000); // server IP or DNS, and port
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy