This document contains code snippets related to Spring Security configuration and authentication. It defines classes and methods for configuring security, processing login requests, loading user details, and authenticating users. Key aspects include configuring security filters and authorization rules, processing username/password authentication, validating login credentials against encoded passwords, and loading pre-authenticated users based on access tokens.
The document discusses implementing an event-driven architecture using events instead of synchronous APIs. It explains that events decouple services by allowing them to communicate asynchronously through a centralized event routing system. This loose coupling makes services more independent and resilient, as failures in downstream services do not block upstream ones. It also improves scalability and maintainability by reducing dependencies between services. The document provides examples to illustrate how an event-driven system has less coupling between producers and consumers compared to a synchronous API approach.
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
This document provides an introduction to Cloud Foundry. It discusses why PaaS is useful, describes the key components of Cloud Foundry including the Cloud Controller, Cells, Buildpacks, and Services. It then provides instructions on how to deploy applications to Cloud Foundry including Java applications using Spring Boot or Java EE, as well as applications in other languages. It also covers scaling applications, the use of Organizations and Spaces, logging, and blue/green deployments.
This document contains code snippets related to Spring Security configuration and authentication. It defines classes and methods for configuring security, processing login requests, loading user details, and authenticating users. Key aspects include configuring security filters and authorization rules, processing username/password authentication, validating login credentials against encoded passwords, and loading pre-authenticated users based on access tokens.
The document discusses implementing an event-driven architecture using events instead of synchronous APIs. It explains that events decouple services by allowing them to communicate asynchronously through a centralized event routing system. This loose coupling makes services more independent and resilient, as failures in downstream services do not block upstream ones. It also improves scalability and maintainability by reducing dependencies between services. The document provides examples to illustrate how an event-driven system has less coupling between producers and consumers compared to a synchronous API approach.
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
This document provides an introduction to Cloud Foundry. It discusses why PaaS is useful, describes the key components of Cloud Foundry including the Cloud Controller, Cells, Buildpacks, and Services. It then provides instructions on how to deploy applications to Cloud Foundry including Java applications using Spring Boot or Java EE, as well as applications in other languages. It also covers scaling applications, the use of Organizations and Spaces, logging, and blue/green deployments.
The document discusses Java programming and transactions. It describes reading transaction data from a CSV file, parsing the data into Transaction objects, and summarizing the transaction amounts. It covers improvements such as using generics, try-with-resources for file handling, LocalDate instead of Date, and various Java features between versions.
2019/11/23 JJUG CCC 2019 Fall
「多言語対応の仮想マシンGraalVMが照らす未来」のセッションスライドです。
---
オラクル社からGraalVMというOSSプロダクトが発表され、話題を呼んでいます。GraalVMは、Javaで書かれたJITコンパイラ、Graalを搭載しています。さらに、言語実装用のフレームワークTruffleを提供しており、そのフレームワークを使って実装したJavaScriptやRuby、Pythonなど他の言語を、GraalVMは高いパフォーマンス実行できます。GraalVMを多言語対応の仮想マシンと呼ぶ理由です。加えて、それらすべての言語間で、相互に呼び出しができます。また、ネイティブイメージを作成し、JVMを利用せずにアプリケーションを実行できます。MicronautやQuarkus、Helidonといった最新のフレームワークが、この機能を利用して起動時間の短縮を図っています。ともすれば、GraalVMとは、ネイティブイメージを作成するためのものである、というイメージを持たれている方もいるかもしれません。しかし、GraalVMが持つパワーは、それだけではありません。このセッションでは、上述のGraalVMの概要の説明やデモに加え、単にGraalVMの使い方に留まらず、GraalVMによって今後何が実現されるのか、世界でのGraalVMの活用事例、Java on iOSとの関連、といったことお話しします。
Introduction to GraalVM and Native ImageKoichi Sakata
2019/08/23 JVM Language Summit Report Event at KanJava JUG
https://kanjava.connpass.com/event/139770/
This slide is about GraalVM, especially SubstrateVM that is able to generate native images.
Bytecode Manipulation with a Java Agent and Byte BuddyKoichi Sakata
Oracle Code One 2018, Birds of a Feather (BOF) Session
Bytecode Manipulation with a Java Agent and Byte Buddy
[BOF5314]
Tuesday, Oct 23, 07:30 PM - 08:15 PM | Moscone West - Room 2005
Have you ever manipulated Java bytecode? There are several bytecode engineering libraries, and Byte Buddy is one of the easiest, and you can also use Java agents, which are related to the Instrumentation class in the java.lang.instrument API. Instrumentation is the addition of bytecode to methods. Because the changes are purely additive, a Java agent does not modify application state or behavior. With Byte Buddy and a Java agent, we can add behaviors to existing classes. This session explains what Java agents and the instrumentation API are, introduces Byte Buddy, and presents sample code that uses a Java agent and Byte Buddy to modify behavior. The presentation will be useful for those who want to start manipulating Java bytecode with Byte Buddy.
2018 Jul 25th LINE Developer Meetup #41 in Fukuoka
Session Slide in English / セッションスライドです。
Graal in GraalVM - A New JIT Compiler
オラクル社からGraalVMというものが発表され、話題を呼んでいます。GraalVMはHotSpot VM上に新しいJITコンパイラGraalと言語実装用フレームワーク/ASTインタプリタであるTruffle、さらにネイティブイメージ作成機能とその実行に使われるSubstrateVMを併せ持ったものです。すでにTruffleを使用したJavaScriptやRuby、R、Pythonの実装も提供されており、これらの言語とJavaはコードから相互に呼び出しができます。このセッションではGraalVMを概観したあと、JITコンパイラGraalにとくに注力して解説します。GraalとTruffleはOracle Labsとヨハネス・ケプラー大学で共同研究されており、多くの論文が発表されています。HotSpotのJITコンパイラとパフォーマンスや構造などを比較しつつ、GraalのJITコンパイルのテクニックについてもいくつか触れます。とにかく、私がGraalをとても好きなのです。デモも実施しつつ、Graalのすごさを伝えられればと考えています。
2018/03/20(火)に開催した関西Javaエンジニアの会(関ジャバ) '18 3月度イベントでのスライドです。
・From Java EE to Jakarta EE
InfoQ.comの翻訳担当でJava EE関連の記事をかなりの数翻訳しました。MicroProfileのこと、EE4Jのこと、Java EEの名称変更のことなどを話します。
“Purikura” culturein Japan andour web application architectureKoichi Sakata
Koichi Sakata presented on Japanese culture, specifically "Purikura" photo booths, and their web application architecture using technologies like MogileFS and Spring Cloud Contract Stub Runner. MogileFS is a distributed file system they use to manage terabytes of data across 15 storage nodes. Spring Cloud Contract Stub Runner allows them to test microservices by replacing services with stubs during testing. "Purikura" photo booths are popular in Japanese culture, where printed photos and digital images can be customized with stickers and effects.
- The document discusses how Scala code is compiled to Java Virtual Machine (JVM) bytecodes. It begins with an introduction to Koichi Sakata, the presenter, and an overview that the session will look at JVM bytecodes for beginners.
- The presentation then asks if attendees know what happens when Scala code is compiled. It is explained that Scala code, like code from other JVM languages, is compiled to class files that contain JVM bytecodes.
- An example Java class file is opened in a binary editor to show the JVM bytecode format. It is explained that class files have a defined format with elements like magic number, version, and bytecode instructions.
29. 移行先FWで調査した候補
Spring
Spring MVC
Spring Boot
Java EE
JSF
JAX-RS
Jersey MVC
Play Framework
Spark Framework
Jodd
Ninja
Doma
JOOQ
JDBI
Bootiful SQL Template
A simple SQL template
engine for Spring Boot
95. MethodValidationの
Bean設定
@Bean public LocalValidatorFactoryBean l() {
LocalValidatorFactoryBean l = new LocalValidatorFactoryBe...
ReloadableResourceBundleMessageSource r =
new ReloadableResourceBundleMessageSource ();
r.setBasename("classpath:/messages");
l.setValidationMessageSource(r);
return l;
}
@Bean public MethodValidationPostProcessor
m(LocalValidatorFactoryBean l) {
MethodValidationPostProcessor m =
new MethodValidationPostProcessor();
m.setValidator(l);
return m;
}
106. java.lang.Error: djUnit class load error
(Class : com.example.ExampleClass)
at jp.co.dgic.testing.common.DJUnitClassLoader.findClass
(ClassLoader.java:424)
at jp.co.dgic.testing.common.DJUnitClassLoader.loadClass
(DJUnitClassLoader.java:45)
at java.lang.ClassLoader.loadClass
(ClassLoader.java:357)
at com.example.ExampleClassTest.setUp
(ExampleClassTest.java:79)
djUnitでエラーが発生