簡體   English   中英

Spring Data findById(HashKey)掛起

[英]Spring Data findById (HashKey) hang

我有一個組件(A)pom,它引用2個常見組件。 具有所有AWS DynamoDB配置的一個通用組件B。 具有所有Kinesis Client Lib配置的其他通用組件C

組件A是spring boot應用程序,當我以Kinesis客戶端使用者身份啟動時,該應用程序啟動沒有任何問題。

當我在Kinesis流中發送請求時,所請求的事件被使用,並且我們基於在事件上傳遞的哈希鍵查找DynamoDB。 我可以看到SimpleDynamoDBPagingAndSortingRepository正在加載正確的數據並從DB中獲取值,但是控件從不返回我的方法(從我的應用程序一側,控件只是掛起了)。 我可以看到春季在內部發生了多播事件的循環,但不清楚原因。

    @Id
@DynamoDBHashKey
private String key;

我的POM依賴項是

--- maven-dependency-plugin:3.0.2:tree (default-cli)  ---
[INFO] com.myteam.project:request-processor:jar:1.0.0-SNAPSHOT
[INFO] +- com.myteam.project:common-component:jar:1.0.0-SNAPSHOT:compile
[INFO] |  +-com.github.spullara.mustache.java:compiler:jar:0.9.2:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.7:compile
[INFO] |  +- org.springframework.retry:spring-retry:jar:1.2.2.RELEASE:compile
[INFO] |  +- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] |  |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] |  +- com.amazonaws:aws-java-sdk-ses:jar:1.11.306:compile
[INFO] |  +- com.amazonaws:aws-java-sdk-sts:jar:1.11.306:compile
[INFO] |  +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.11.306:compile
[INFO] |  |  \- com.amazonaws:aws-java-sdk-s3:jar:1.11.306:compile
[INFO] |  +- com.amazonaws:aws-java-sdk-kms:jar:1.11.306:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.6:compile
[INFO] |  +- com.github.spring-data-dynamodb:spring-data-dynamodb:jar:5.0.2:compile
[INFO] |  |  +- org.springframework:spring-context:jar:5.0.9.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-tx:jar:5.0.9.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.0.10.RELEASE:compile
[INFO] |  |  +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
 [INFO] |  |  \- javax.enterprise:cdi-api:jar:1.2:compile
 [INFO] |  |     +- javax.el:javax.el-api:jar:3.0.0:compile
 [INFO] |  |     +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
[INFO] |  |     \- javax.inject:javax.inject:jar:1:compile
[INFO] |  +- io.springfox:springfox-swagger2:jar:2.4.0:compile
[INFO] |  |  +- io.swagger:swagger-annotations:jar:1.5.6:compile
[INFO] |  |  +- io.swagger:swagger-models:jar:1.5.6:compile
[INFO] |  |  +- io.springfox:springfox-spi:jar:2.4.0:compile
[INFO] |  |  |  \- io.springfox:springfox-core:jar:2.4.0:compile
[INFO] |  |  +- io.springfox:springfox-schema:jar:2.4.0:compile
[INFO] |  |  +- io.springfox:springfox-swagger-common:jar:2.4.0:compile
[INFO] |  |  +- io.springfox:springfox-spring-web:jar:2.4.0:compile
[INFO] |  |  +- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  |  \- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  \- org.springframework.security:spring-security-crypto:jar:5.0.8.RELEASE:compile
[INFO] +- com.myteam.components:kinesis-client-library-component:jar:1.0.0-SNAPSHOT:compile
[INFO] |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  \- com.amazonaws:amazon-kinesis-client:jar:1.9.2:compile
[INFO] |     +- com.amazonaws:aws-java-sdk-cloudwatch:jar:1.11.306:compile
[INFO] |     +- com.google.protobuf:protobuf-java:jar:2.6.1:compile
[INFO] |     \- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.5.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.5.RELEASE:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.5.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.34:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.34:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.34:compile
[INFO] |  +- org.hibernate.validator:hibernate-validator:jar:6.0.12.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  +- org.springframework:spring-web:jar:5.0.9.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.0.9.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.0.9.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.0.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.5.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] |  |  \- org.springframework.boot:spring-boot-actuator:jar:2.0.5.RELEASE:compile
[INFO] |  \- io.micrometer:micrometer-core:jar:1.0.6:compile
[INFO] |     +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
[INFO] |     \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-aop:jar:2.0.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:5.0.9.RELEASE:compile
[INFO] |  \- org.aspectj:aspectjweaver:jar:1.8.13:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.5.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.0.5.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.5.RELEASE:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] |  +- junit:junit:jar:4.12:test
[INFO] |  +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:5.0.9.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.0.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-test:jar:5.0.9.RELEASE:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.5.1:test
[INFO] +- com.amazonaws:aws-java-sdk-kinesis:jar:1.11.306:compile
[INFO] |  +- com.amazonaws:aws-java-sdk-core:jar:1.11.306:compile
[INFO] |  |  +- software.amazon.ion:ion-java:jar:1.0.2:compile
[INFO] |  |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.9.6:compile
[INFO] |  \- com.amazonaws:jmespath-java:jar:1.11.306:compile
[INFO] +- com.twilio.sdk:twilio:jar:7.17.0:compile
[INFO] |  +- com.google.guava:guava:jar:18.0:compile
[INFO] |  +- joda-time:joda-time:jar:2.9.9:compile
[INFO] |  +- io.jsonwebtoken:jjwt:jar:0.4:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] |  \- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] +- org.mockito:mockito-all:jar:1.10.19:test
[INFO] \- org.mockito:mockito-core:jar:2.21.0:test
[INFO]    +- net.bytebuddy:byte-buddy:jar:1.7.11:test
[INFO]    +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO]    \- org.objenesis:objenesis:jar:2.6:test

根據我的依賴性指標,與Spring jar是否有沖突? 不知道為什么在這種情況下不會拋出異常。

問題已解決。 看起來,如果我們將Kinesis Worker作為主線程的一部分啟動,則在嘗試在對象上進行同步以從DB組播“ AfterLoad”事件時,Spring數據將被阻塞。 我必須在單獨的線程中啟動Kinesis worker,以解決此問題。 分辨率在這里更新https://github.com/derjust/spring-data-dynamodb/issues/201

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM