Skip to content

Instantly share code, notes, and snippets.

View geoand's full-sized avatar

Georgios Andrianakis geoand

View GitHub Profile
@fitzoh
fitzoh / SpringCloudGatewayApplication.java
Created September 7, 2017 01:24
Canary deploys with spring-cloud-gateway (2.0.0-M1)
@EnableGateway
@SpringBootApplication
public class SpringCloudGatewayApplication {
private final String cookieName = "beta_active";
private final String headerName = "X-Beta-active";
private final String betaActiveValue = "true";
/**
* They're in the beta if they have a cookie or request header set
@joshlong
joshlong / DynamicIntegration.kt
Last active January 6, 2018 01:42
Dynamic registration of Spring Integration adapters using functional bean definition with the Spring Framework 5.0 Kotlin DSL.
package com.example.feed
import com.rometools.rome.feed.synd.SyndEntry
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.context.support.beans
import org.springframework.core.io.UrlResource
import org.springframework.integration.dsl.IntegrationFlows
import org.springframework.integration.feed.dsl.Feed
import org.springframework.integration.handler.GenericHandler
@thomasdarimont
thomasdarimont / readme.md
Created February 23, 2018 09:21
Wait for HTTP Service to become available with timeout (bash)
timeout 40s /bin/bash -c "while ! httping -qc1 http://somehost:8080/app ; do sleep 1 ; done; echo OK" || echo TIMEOUT

If the service cannot be reached within 40s then TIMEOUT will be printed otherwise OK.