Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
😼

Mark Paluch mp911de

:octocat:
😼
View GitHub Profile
@mp911de
mp911de / DemoApplication.java
Created Nov 22, 2018
Spring Boot 2.1 with Spring Data Kay and MongoDB 3.5.0
View DemoApplication.java
package com.example.demo;
import java.util.Collections;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
View DemoApplication.java
package com.example.demo;
import org.springframework.data.redis.core.RedisTemplate;
import reactor.core.publisher.Mono;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
View DemoApplication.java
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
View NamespaceScopedVaultTemplate.java
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ElastiCacheWithSpringDataRedis.java
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View SpringDataRedisPlaygroundApplication.java
package com.example;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import java.io.Serializable;
import org.springframework.boot.CommandLineRunner;
View PropertyAccessorFactoryBenchmarks.java
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / Standalone.java
Created Oct 30, 2017
Create Redis Connections with pooling
View Standalone.java
/*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / CommandHandlerBuffers.java
Created Sep 25, 2017
Accessing CommandHandler buffers in Lettuce 4
View CommandHandlerBuffers.java
RedisClient redisClient = RedisClient.create(RedisURI.Builder.redis("localhost", 6379).build());
StatefulRedisConnection<String, String> redis = redisClient.connect();
RedisChannelHandler<String, String> channelHandler = (RedisChannelHandler) redis;
CommandHandler<String, String> commandHandler = (CommandHandler) channelHandler.getChannelWriter();
Collection<RedisCommand<String, String, ?>> disconnectedBuffer = null; // reflective access to commandHandler.disconnectedBuffer
Collection<RedisCommand<String, String, ?>> commandBuffer = null; // reflective access to commandHandler.commandBuffer
View Demo9Application.java
package com.example.demo9;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Demo9Application implements CommandLineRunner {