skip to Main Content

Android Studio – How to receive the message from stomp websocket with spring boot on android?

I've got the simple WebSocket example from https://spring.io/guides/gs/messaging-stomp-websocket/ package com.example.chatservice.message; import org.springframework.context.annotation.Configuration; import org.springframework.messaging.simp.config.MessageBrokerRegistry; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; import org.springframework.web.socket.config.annotation.StompEndpointRegistry; import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker("/topic"); config.setApplicationDestinationPrefixes("/app"); } @Override public void…

VIEW QUESTION

How to mock HashOperations of Spring StringRedisTemplate?

I'm writing unit test for my CacheService class: public class CacheService { private final HashOperations<String, String, String> redisHashOps; private final ValueOperations<String, String> valueOps; private final SetOperations<String, String> setOps; public CacheService(StringRedisTemplate redisTemplate) { this.redisHashOps = redisTemplate.opsForHash(); this.valueOps = redisTemplate.opsForValue(); this.setOps =…

VIEW QUESTION

Spring Boot Redis Cache remove cache with multiple key

I have a method that saves cache. @GetMapping("/orders") @Cacheable(value = "List<Order>", key = "{#customerName+'s orders', #page, #size}") public List<Order> findOrders(@RequestParam("customerName") String customerName, @RequestParam(name = "page") int page, @RequestParam(name = "size") int size) { ... And I want to remove this…

VIEW QUESTION

Redis – Spring boot Cacheable annotation with JPA entity

I'm trying to caching jpa entity to redis through @Cacheable annotation. [RedisConfig.class] @Configuration public class RedisConfig { @Value("${spring.redis.host}") private String host; @Value("${spring.redis.port}") private int port; @Bean public RedisConnectionFactory redisConnectionFactory() { return new LettuceConnectionFactory(host, port); } @Bean public RedisTemplate<?, ?> redisTemplate()…

VIEW QUESTION
Back To Top
Search