Spring
build.gradle plugins { id 'java' id 'org.springframework.boot' version '3.0.6' id 'io.spring.dependency-management' version '1.1.0' } group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' configurations { compileOnly …
Spring Batchは5.0から色々な変更が入った事を最近知った。 docs.spring.io What's new in Spring Batch 5 from ikeyat www.slideshare.net なので、良くやる設定などでとりあえず触ってみる。何分初めてさわるバージョンなので間違ってる事書いていたら申し…
リファレンスとしては https://cloud.spring.io/spring-cloud-stream-binder-kafka/spring-cloud-stream-binder-kafka.html#kafka-dlq-processing のあたり。 plugins { id 'org.springframework.boot' version '2.4.0' id 'io.spring.dependency-management…
https://docs.spring.io/spring-batch/docs/current/reference/html/monitoring-and-metrics.html を試す。 Spring Batch 4.2はMicrometerベースのメトリクスを自動的に収集する。なので、プロパティでそのメトリクスの送信設定をすれば、データがそちらに送…
https://spring.io/projects/spring-cloud-openfeign をさわる。 FeignというRESTクライアントとspringをいい感じに連携する、という代物らしい。 使ってみる Spring Initializrでプロジェクトを作る。dependencyにopenfeignをいれる。あと、今回はレスポン…
Spring Cloud Consulさわる。Service DiscoveryとLoadBalancerのチュートリアルレベルのことをやる。ただし、LoadBalancerの挙動(ex. 2つ以上のserivce切り替えなど)まではやらない。 Consulとは、一言で表現するのが難しい(俺自身が良く理解してない)が…
Spring Cloud Circuit Breaker https://spring.io/projects/spring-cloud-circuitbreaker#overview のチュートリアルレベルのことをやる。 Spring Cloud Circuit Breaker自身は抽象APIを提供するだけで、使う際には具体的な実装を選択する、というタイプ。以…
https://spring.io/projects/spring-cloud-gateway をさわる。はじめてさわるのでpredicateとかfilterとかをいくつか使ってみる。使い方わからなかったやつはさわってない。個人の日記レベルのさわってみた程度なんで、ちゃんとした情報はリファレンスを参照…
現象 タイトル通りSpring Batch + MySQL + JTA(Atomikos)環境下で以下のような例外がスローされる。 Caused by: org.springframework.dao.DataAccessResourceFailureException: Unable to commit new sequence value changes for BATCH_JOB_SEQ at org.sprin…
Spring Batchのチュートリアル https://spring.io/guides/gs/batch-processing/ を動かします。このサンプルはいわゆるデータインポート処理で、CSVからデータ読み込み・変換・保存、を行います。 プロジェクト作成 Spring Bootの組み込みDB自動設定 build.g…
Spring Batchでstep間でデータを共有する方法について。機能的に豊富では無いが、そこはSpring Batchとして積極的に提供する機能では無い、という設計判断なのだと思う。 以下ではそのやり方について述べる。 JobのExecutionContext JobのExecutionContextに…
http://kagamihoge.hatenablog.com/entry/2020/02/14/091501 ではSpring Cloud Configを試した。問題点としてプロパティの更新がある。/actuator/refreshで1つのclientのリフレッシュは出来るが、100個あったら100回送信しなければならない。その解決方法に…
Spring Cloud Config を試す。 gitリポジトリの準備 適当なローカルディレクトリとか、GitHubとか、http://kagamihoge.hatenablog.com/entry/2020/02/13/095145 とか、なんでも良いが適当なgitリポジトリを準備する。 プロパティファイルとして/sample.prope…
ソースコード plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.RELEASE' id 'java' } dependencies { implementation 'org.springframework.boot:spring-boot-starter-batch' compil…
https://terasoluna-batch.github.io/guideline/5.0.0.RELEASE/ja/Ch05_FileAccess.html によると、コントロールブレイク処理(またはキーブレイク処理)、と呼ぶものをspring-batchで実現する方法について。 コントロールブレイク処理(またはキーブレイク処理…
https://docs.spring.io/spring-batch/docs/current/reference/html/scalability.html#partitioning のPartitioningを試す。 ソースコード plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version …
https://docs.spring.io/spring-batch/docs/4.1.x/reference/html/spring-batch-integration.html#remote-chunking のRemote Chunkingをためす。 このサンプルは、Spring Integegration -> Active MQを介してMasterからworkerおprocessor + writerを呼び出す…
Spring Bootでhttp://activemq.apache.org/を使用しての送受信のhello worldレベルのことをやる。 手順など Apache ActiveMQのインストール http://activemq.apache.org/をインストールする。まずbin/artemis create 名前を実行する。以下はbin/artemis crea…
https://docs.spring.io/spring-batch/docs/current/reference/html/scalability.html#scalabilityParallelSteps のパラレルstepを試す。http://kagamihoge.hatenablog.com/entry/2020/01/07/110847 は単一のstepをマルチスレッド化する方法だが、こちらは複…
https://docs.spring.io/spring-batch/docs/current/reference/html/scalability.html#scalability のMulti-threaded Stepを試す。 plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.…
spring-securityのDomain Object Security (ACLs)のhelllo world的なとりあえず動くところまでをやる。 ソースコード build.gradle plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.…
spring-bootでは、例えば以下のようにparentとdependencyを指定しておけば、spring-webとかspring-mvcとかの依存性をよしなに解決してくれる。以下のように書くとspring-webmvc-5.2.1.RELEASE.jarが解決されるが、このエントリではそれがどのようにして行わ…
手順など pom.xml コメントアウトの箇所は後述。 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.0.RELEASE</version> <relativePath /> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceencoding></properties>
Thymeleafコアには含まれない、spring-securityとThymeleafを結び付けて使うためのThymeleaf Extrasモジュールの基本的な使い方に関するメモ。基本的に、このエントリは https://github.com/thymeleaf/thymeleaf-extras-springsecurity のドキュメントを基に…
Spring BootでSpring Securityをredisでうごかすでは、spring-securityのセッション保存先をredisに変更した。このエントリはspring-securityを伴わない場合だが、やることはほとんど変わらない。 やること redisのインストール 他サイトを見て適当なマシン…
RedisのkeysがO(N)を実際に見る で見たようにKEYSは登録キー件数によってはかなり遅くなる。次に、特に重いKEYS *を同時に複数実行すると、タイムアウトするらしいので、そこを実際にやってみる。 ソースコード <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-start</artifactid></parent>…
RedisのKEYSはO(n)な点に注意が必要、と各種文献に書かれている。なので実際にデータ作ってみて試してみる。 ソースコード <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.7.RELEASE</version> <relativePath /> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceencoding></properties>
redis初心者です。以下は https://docs.spring.io/spring-data-redis/docs/current/reference/html/#pipeline の抄訳。 5.11. Pipelining Redisにはパイプライン(https://redis.io/topics/pipelining)があり、これはリプライを待たずにサーバへ複数コマン…
現象 ほぼタイトルで言い切っているけど。spring-batchでメタデータ保存でDBを使わなないようインメモリに格納するMapJobRepositoryFactoryBeanを使う場合が稀に良くある。この状況下で大量のstepを含むjobを実行すると徐々に実行速度が低下していく、という…
spring-integration勉強中です。 spring-integrationに文字列でjob名を渡し、その先でspring-batchを起動、をつくる。https://github.com/pakmans/spring-batch-integration-example/blob/master/pom.xml を参考にした。