Skip to content

Instantly share code, notes, and snippets.

View dsyer's full-sized avatar

Dave Syer dsyer

View GitHub Profile
@dsyer
dsyer / README.md
Last active February 5, 2017 07:25
Messaging Microservices

Messaging Microservices

Messaging and asynchronous patterns are completely natural with microservices, but a lot of the start of the art material concentrates on HTTP, JSON and REST. This document is about "Message-driven Microservices" with Spring. It tracks the convergence of various ideas that are floating around in Spring Cloud, Spring Boot and Spring XD.

There is already a spring-xd-module-runner project where we started experimenting with allowing user to develop and run an XD module locally. We can extrapolate from there to a more flexible model that leads optionally to a deployable XD module, but can also be used to form more flexible structures than a simple "stream".

Basic Programming Model

Just create MessageChannels "input" and/or "output" and add @EnableMessageBus and run your app as a Spring Boot app (single application context). You need to connect to the physical broker for the bus, which is automatic if the relevant bus imple

Keybase proof

I hereby claim:

  • I am dsyer on github.
  • I am dsyer (https://keybase.io/dsyer) on keybase.
  • I have a public key whose fingerprint is 032D F42A 76D3 4CD8 DE76 BEFC 257D 4510 E2E1 1827

To claim this, I am signing this object:

@dsyer
dsyer / wipe.md
Last active August 29, 2015 14:05
Notes on WebInvocationPrivilegeEvaluator in Java config

From WebSecurityConfigurerAdapter.init(WebSecurity):

public void init(final WebSecurity web) throws Exception {
  final HttpSecurity http = getHttp();
  web
    .addSecurityFilterChainBuilder(http)
    .postBuildAction(new Runnable() {
      public void run() {
 FilterSecurityInterceptor securityInterceptor = http.getSharedObject(FilterSecurityInterceptor.class);
@dsyer
dsyer / docker-compose.yml
Last active February 20, 2016 14:09
Example fig.yml for 2 services that want to chat over HTTP
configserver:
image: dsyer/java
volumes:
- ./configserver:/var/run/app
command: bash -c 'java -jar /var/run/app/target/*.jar'
links:
- eureka
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
@dsyer
dsyer / README.md
Last active September 25, 2019 04:09
Infrastructure Advisors and Spring ApplicationContext lifecycle

Aggressive Bean Instantiation and "Unproxyable" Beans

This project is a minimal setup depending only on spring-context but mimicking closely the mess that you get into with @EnableTransactionManagement (spring-tx) or @EnableGlobalMethodSecurity (spring-security). These annotations lead to registration of an InfrastructureAdvisorAutoProxyCreator which is responsible for locating the Advisor bean that provides the enabled feature. The mess is caused by aggressive bean instantiation in that component which can cause cascades of unsafe bean instantation

@dsyer
dsyer / reactor.md
Created June 2, 2014 14:10
FRP Notes

Notes on Reactive Programming

Reactive Programming is sexy (again) and a lot of people are making a lot of noise about it at the moment, not all of which is very easy to understand for an outsider and lowly enterprise Java developer like me. These notes are what I came up with to help me clarify my understanding of what the noise is about. I have tried to keep them as concrete as possible, and promise not to mention "denotational semantics" because I don't have a higher degree in Computer Science (and if I did it's hard to see how it would help). If you are looking

@dsyer
dsyer / README.md
Created February 27, 2013 08:34
Link demo POC

Demo for links

@dsyer
dsyer / .gitignore
Created June 13, 2012 14:12
Spring Batch @configuration samples using step scope
*~
#*
.#*
.gradle
*.sw?
*.class
.classpath
.project
.settings
bin
@dsyer
dsyer / .gitignore
Created April 19, 2012 14:06
Spring Security OAuth2 samples with custom OAuth2 endpoint URLs
*/src/META-INF/
*/src/main/java/META-INF/
samples/*/*/src/main/webapp/META-INF/
target/
.classpath
.project
.DS_Store
.settings/
*.iml
*.iws
@dsyer
dsyer / .gitignore
Created April 10, 2012 17:45
Basic no-op cloudfoundry service gateway
*.gem
.bundle
Gemfile.lock
pkg/*
vendor/
*~
#*
dev.yml