Skip to content

Instantly share code, notes, and snippets.

View JosephGaiser's full-sized avatar
🤡
HIGHLY DISTRIBUTED BIG BALL OF MUD

13 JosephGaiser

🤡
HIGHLY DISTRIBUTED BIG BALL OF MUD
View GitHub Profile
@JosephGaiser
JosephGaiser / StackTrace -Error: Blocking call! java.io.FileInputStream#readBytes
Last active December 5, 2019 19:14
R2DBC-mssql Stack trace from blocking call
2019-12-05 10:32:17.082 ERROR 51683 --- [actor-tcp-nio-2] i.r2dbc.mssql.client.ReactorNettyClient : Exchange cancelled while exchange is active. This is likely a bug leading to unpredictable outcome.
2019-12-05 10:32:17.082 WARN 51683 --- [actor-tcp-nio-7] i.r2dbc.mssql.client.ReactorNettyClient : Error: Blocking call! java.io.FileInputStream#readBytes
java.lang.Error: Blocking call! java.io.FileInputStream#readBytes
at reactor.blockhound.BlockHound$Builder.lambda$new$0(BlockHound.java:196) ~[blockhound-1.0.1.RELEASE.jar:na]
at reactor.blockhound.BlockHound$Builder.lambda$install$6(BlockHound.java:318) ~[blockhound-1.0.1.RELEASE.jar:na]
at reactor.blockhound.BlockHoundRuntime.checkBlocking(BlockHoundRuntime.java:46) ~[na:na]
at java.base/java.io.FileInputStream.readBytes(FileInputStream.java) ~[na:na]
at java.base/java.io.FileInputStream.read(FileInputStream.java:279) ~[na:na]
at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252) ~[na:na]

Contract

This contract is set up to respond to POST requests to the /person endpoint with a 201.
The body of the response will reflect the values passed in the request.

name: Post person
request:
  method: POST
  urlPath: /person
  headers:
    Content-Type: application/json
@JosephGaiser
JosephGaiser / TestContainersExampleRepo.kt
Last active April 17, 2020 20:58
Example of a testcontainer repository wrapped in a class
package com.foo.bar
import io.r2dbc.spi.ConnectionFactories
import org.flywaydb.core.Flyway
import org.springframework.data.r2dbc.core.DatabaseClient
import org.testcontainers.junit.jupiter.Container
import org.testcontainers.junit.jupiter.Testcontainers
private const val username = "my_username"
private const val password = "my_password"
@JosephGaiser
JosephGaiser / filter-branch.sh
Created August 18, 2020 18:14
Rewrite history to remove any sensative data without deleteing files
# Sync with the remote master
git pull
# Force your clone to look like HEAD
git reset --hard
# AGAIN, A WARNING: This can really break stuff!
# Run your filter branch command, replacing all instances of "password" with "your_password"
# The example looks for Ruby files ("*.rb"), you can change this to match your needs
@JosephGaiser
JosephGaiser / filter-branch.sh
Created August 18, 2020 18:14
Rewrite history to remove any sensative data without deleteing files
# Sync with the remote master
git pull
# Force your clone to look like HEAD
git reset --hard
# AGAIN, A WARNING: This can really break stuff!
# Run your filter branch command, replacing all instances of "password" with "your_password"
# The example looks for Ruby files ("*.rb"), you can change this to match your needs