Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Rohan Liston
    @rohanliston
    Whoops - user error. I hadn't set the Gradle project to auto-refresh within IntelliJ.
    It's working now.
    Mike Eltsufin
    @meltsufin
    :thumbsup:
    William S Johnstone III
    @wjohnst3
    Hey, when calling GCP Secretes Manager I have been putting a @Value annotation like so... @Value("${sm://my-secrete}") However, I need to sometimes default this to "". Is that possible?
    Daniel Zou
    @dzou

    @wjohnst3 -- Hey, unfortunately right now the best we can do for defaulting is related to environment variables: example.secret=${MY_ENV_VARIABLE:${sm://application-secret/latest}} i.e. if MY_ENV_VARIABLE is set, use that, else use the secret.

    We can try to support your use-case though. So in this case, if sm://my-secrete does not exist, you want to default to empty string?

    6 replies
    Ryan Baxter
    @ryanjbaxter
    We are going to be doing a Hoxton SR10 release on Thursday does Spring Cloud GCP 1.2.x need a release?
    Mike Eltsufin
    @meltsufin
    Yes, please, we have some bug fixes since 1.2.6.
    Felipe Adorno
    @FelipeAdorno
    Hi I'm try change from spring-cloud-stream-rabbitmq to spring-cloud-gcp-pubsub-stream-binder but I need autoconfigure DLQ and message ordering, I can achieve that using configuration properties?
    Mike Eltsufin
    @meltsufin
    auto-creating DLQ is in the works (GoogleCloudPlatform/spring-cloud-gcp#358), but you can also just create the DQL topic and subscriptions yourself. There is an issue for message ordering (GoogleCloudPlatform/spring-cloud-gcp#85 ).
    Jonathan Schneider
    @jkschneider
    hi, we just worked out all the terraform necessary to provision a spring cloud eureka server on GCP. anybody at google or elsewhere have a place where we could post a blog or guide on how to do this? wasn’t obvious.
    Mike Eltsufin
    @meltsufin

    hi, we just worked out all the terraform necessary to provision a spring cloud eureka server on GCP. anybody at google or elsewhere have a place where we could post a blog or guide on how to do this? wasn’t obvious.

    I think GCP Community could be great place for something like this. See: https://cloud.google.com/community/tutorials/write

    gabalmat
    @gabalmat

    Hi all, I have an application that needs to read from a GCP Firestore (native mode) database. I would like to use Spring Data repositories, however the only Repository interface I'm able to find for native mode is FirestoreReactiveRepository.

    The problem is that my application is non-reactive and I need the ability to access another non-reactive relational db. When I try to add spring-boot-starter-data-jpa to my project, I get the following error:
    Reactive Repositories are not supported by JPA. Offending repository is <MyRepositoryWhichExtendsFiretoreReactiveRepository>

    Does anyone know of another way to use Spring Data Repositories with Firestore in native mode bedsides using FirestoreReactiveRepository? Thanks in advance!

    Mike Eltsufin
    @meltsufin
    We only support reactive repositories for Firestore currently.
    Spring Data Datastore might be an option for you since it actually uses the same Firestore back-end.
    1 reply
    Spencer Gibb
    @spencergibb
    When we update to boot 2.3.10 via spring-cloud-build 2.3.4.RELEASE gcp has a compile error
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project spring-cloud-gcp-storage: Compilation failure
    [ERROR] /home/spencer/workspace/spring/spring-cloud-gcp/spring-cloud-gcp-storage/src/main/java/org/springframework/cloud/gcp/storage/integration/filters/GcsPersistentAcceptOnceFileListFilter.java:[31,8] org.springframework.cloud.gcp.storage.integration.filters.GcsPersistentAcceptOnceFileListFilter is not abstract and does not override abstract method isDirectory(com.google.cloud.storage.BlobInfo) in org.springframework.integration.file.filters.AbstractDirectoryAwareFileListFilter
    looks like a change in spring integration
    Spencer Gibb
    @spencergibb
    Looks like a change like this will fix it
        @Override
        protected boolean isDirectory(BlobInfo blobInfo) {
            return (blobInfo != null) ? blobInfo.isDirectory() : false;
        }
    working on the Hoxton.SR11 release
    Spencer Gibb
    @spencergibb
    artem approved it for me
    Mike Eltsufin
    @meltsufin
    Thanks for taking care of it!
    Spencer Gibb
    @spencergibb
    we're planning to change the default branch from master to main
    Spencer Gibb
    @spencergibb
    done. locally run
    git branch -m master main
    git fetch origin
    git branch -u origin/main main
    git remote set-head origin -a
    Mike Eltsufin
    @meltsufin
    sounds good, we've already done that in the new repo.
    William S Johnstone III
    @wjohnst3
    Hi all, I'm upgrading an existing boot app to 2.4.5 and I'm wondering what to do with my GCP config from the bootstrap.yml. I found a post saying for me to throw it in the application.yml, but that doesn't seem to work. I'm using GCP ver 2.0.2. Cloud 2020.0.2. Is this right about the application file?
    2 replies
    Spencer Gibb
    @spencergibb
    hoxton gcp main failing in ci with the following error
    org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration
    Failing for the past 11 builds (Since Failed#1 )
    Took 2 min 16 sec.
    add description
    Error Message
    
    I/O error
    
    Stacktrace
    
    com.google.cloud.datastore.DatastoreException: I/O error
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
    Caused by: com.google.datastore.v1.client.DatastoreException: I/O error
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
    Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.lambda$testDatastoreEmulatorConfiguration$1(GcpDatastoreEmulatorIntegrationTests.java:88)
        at org.springframework.cloud.gcp.autoconfigure.datastore.it.GcpDatastoreEmulatorIntegrationTests.testDatastoreEmulatorConfiguration(GcpDatastoreEmulatorIntegrationTests.java:76)
    Elena Felder
    @elefeint
    I'll look into it
    @spencergibb out of curiosity, when was the last passing build? I don't think I have access to this build (or I don't know where it is)
    Elena Felder
    @elefeint
    I am quite curious how this ever worked?
    has the environment maybe had datastore emulator installed before...
    Mike Eltsufin
    @meltsufin
    the CI probably had some GCP env variables set before
    Spencer Gibb
    @spencergibb
    thanks, it's our internal jenkins. it is where we do releases. that or fixed things
    Elena Felder
    @elefeint
    great!
    Nickolas Heckman
    @nrheckman
    Getting started with Spring Cloud Dataflow, and trying to use GCP Pub/Sub for the messaging broker. The documentation I have found mentions this is possible, but is light on details. Is there another source I should consult for more detail?
    Elena Felder
    @elefeint
    Dataflow uses Spring Cloud Stream, so if you bring in our Spring Cloud Stream binder (spring-cloud-gcp-pubsub-stream-binder), it should work out of the box.
    (topics/subscriptions are autocreated by default; see Spring Cloud GCP Spring Cloud Stream docs for custom configuration)
    Nickolas Heckman
    @nrheckman
    Oh, great. That seemed way too easy to be true... No need to include anything special in the skipper or server configuration? (Other than pass google creds to the applications being deployed)
    Elena Felder
    @elefeint
    In principle, no, but if you run into issues, file them against our new repo -- https://github.com/googlecloudplatform/spring-cloud-gcp
    Elena Felder
    @elefeint
    @spencergibb Could you update the Spring Cloud GCP docs to the 2.0.4 release?
    5 replies
    Philip Bannon
    @BannonPhilip_twitter

    Hi All,

    I'm trying to use GCP Pub sub with spring boot and I want to publish a simple JSON message to a NodeJS API. I found this sample here: https://github.com/spring-cloud/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample but when I try to add

      @Bean
        public JacksonPubSubMessageConverter jacksonPubSubMessageConverter(ObjectMapper objectMapper) {
            return new JacksonPubSubMessageConverter(objectMapper);
        }

    to my project and the dependancy

        implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging'
        implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging', version: '1.2.8.RELEASE'
        implementation platform('com.google.cloud:libraries-bom:22.0.0')
        implementation 'com.google.cloud:google-cloud-pubsub:1.114.2'
        implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-pubsub'
        implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp', version: '1.2.8.RELEASE', ext: 'pom'

    I get the following error: Cannot resolve symbol 'JacksonPubSubMessageConverter'

    Can someone point me in the right direction? Do I need to use Spring integration?

    2 replies
    p10r
    @p10r

    Hello everyone, sorry for coming in with a super specific question, but I keep hitting the wall with that one:
    I want to subscribe to a pubsub topic via a ReactiveFactory like that: private val flux = reactiveFactory.poll(subscriptionName, 1000).
    Reading and acknowledging a message is done as follows:

    val consumer = flux.flatMap { pubsubMessage -> doSomeStuff(pubSubMessage) }
                .doOnNext(AcknowledgeablePubsubMessage::ack)
                .doOnError { log.error("Error consuming message!") }
                .subscribe()

    Two things are now coming up for me:
    1.) I want to .nack() the pubSubMessage if there's an error - unfortunately any kind of doOnError, onErrorContinue etc. has no info about that it's a pubSubMessage that one can nack().
    2.) I would love to work my way in with tests, but I see no way in how I can check if I correctly negatively acknowledge a message.

    I would be incredibly happy if there's someone who could point me to a resource/code fragment/whatever about that - I feel like I read about everything but can't seem to find an answer for that.
    Thanks in advance!

    4 replies
    kswat
    @kswat
    Hi, I want to use secret manager to get database password, but it seems it is not working. My bootstrap.properties contains
    spring.cloud.gcp.secretmanager.enabled=true
    spring.cloud.gcp.secretmanager.bootstrap.enabled=true
    spring.datasource.password=${sm://projects/4*1430/secrets/dbencpwd}
    18 replies
    kswat
    @kswat
    Hello, don't know why none of the google cloud features are working - Eg. accessing/reading file from Cloud storage
    java.io.FileNotFoundException: Could not open ServletContext resource [/gs://bucketimages/hello.txt] similar to
    https://www.titanwolf.org/Network/q/a6c83f76-a4da-487f-b5ef-680cd1d2e445/y
    28 replies
    kswat
    @kswat
    Can someone help please
    kswat
    @kswat

    Hi, I want to store images in cloud storage and access in my spring boot app on appengine.
    https://github.com/spring-cloud/spring-cloud-gcp/blob/main/spring-cloud-gcp-samples/spring-cloud-gcp-storage-resource-sample/src/main/java/com/example/WebController.java
    says only about 1 file - my-file.txt

        private Resource gcsFile;

    There is some configuration that says - serve statis content
    ```# You can also serve static resources by reading them from a bucket.

    spring.web.resources.static-locations=gs://* ```

    8 replies
    Eric Turley
    @ericjturley
    Hey everybody :)
    Can you point me to docs or an example for Spring Cloud GCP BigQuery via Reactive API?
    1 reply
    Nickolas Heckman
    @nrheckman
    I'm using com.google.cloud:spring-cloud-gcp-pubsub-stream-binder:2.0.4 and having trouble getting publisher errors. It looks like PubSubMessageHandler exposes a method to setFailureCallback but none seem to get registered, nor can I see how to register my own. I'm missing something really obvious right?
    7 replies
    Mik
    @Aliandi
    Hey all!
    Anyone here has any experience integrating GCP Profiler for Java apps to an application using bazel? Is thereany documentation around that you might point me to? I couldn't find much.
    2 replies