Skip to content

Instantly share code, notes, and snippets.

View mp911de's full-sized avatar
🚑
I may be slow to respond…

Mark Paluch mp911de

🚑
I may be slow to respond…
View GitHub Profile
package com.example.demor2dbc
import kotlinx.coroutines.flow.Flow
import org.springframework.beans.factory.InitializingBean
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories
import org.springframework.data.repository.kotlin.CoroutineCrudRepository
import org.springframework.stereotype.Service
@mp911de
mp911de / ByteToEmpId.java
Created July 22, 2020 12:27
Spring Data Redis Repository Benchmark
/*
* Copyright 2020 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
/*
* Copyright 2020 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / DefaultRepositoryTagsProvider.java
Created July 8, 2020 07:49
Spring Data Repository Metrics Spring Data Rep
/*
* Copyright 2020 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
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplicationSpringBootGh15311 {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
import java.util.*;
import com.lambdaworks.redis.*;
public class LettuceGeoDemo {
public static void main(String[] args) {
RedisClient redisClient = new RedisClient("localhost", 6379);
RedisConnection<String, String> redis = redisClient.connect();
String key = "my-geo-set";
public class MultithreadedExample {
public static void main(String[] args) throws Exception{
// Syntax: redis://[password@]host[:port][/databaseNumber]
RedisClient redisClient = RedisClient.create(RedisURI.create("redis://localhost:6379/0"));
CountDownLatch latch = new CountDownLatch(1);
List<RedisThread> threads = IntStream.range(0, 100).mapToObj(ignore -> new RedisThread(redisClient, latch))
import io.r2dbc.mssql.MssqlConnectionConfiguration;
import io.r2dbc.mssql.MssqlConnectionFactory;
public class Reproducer {
public static void main(String[] args) {
MssqlConnectionConfiguration config = MssqlConnectionConfiguration.builder()
.host("abcbookstore.database.windows.net")
.database("foo")
@mp911de
mp911de / Standalone.java
Created October 30, 2017 20:35
Create Redis Connections with pooling
/*
* 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 / Parameter.java
Created March 6, 2019 13:44
R2DBC Stored Procedures Proposal
/**
* OUT and IN/OUT parameter wrapper for stored procedures (callable functions).
*
* @param <T>
*/
class Parameter<T> {
@Nullable
private final T value;