繁体   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