Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Spencer Gibb
    @spencergibb
    looks like a change in spring integration
    Looks like a change like this will fix it
        @Override
        protected boolean isDirectory(BlobInfo blobInfo) {
            return (blobInfo != null) ? blobInfo.isDirectory() : false;
        }
    Spencer Gibb
    @spencergibb
    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
    commontyler
    @commontyler
    I am using the latest version 1.2.8.release of spring-cloud-gcp-starter-pubsub and our prisma container scan is revealing this vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2021-37136 stemming off of grpc-netty-shaded-1.34.1.jar. We have upgraded this jar to get past the vulnerability but doing so resulted in breaking spring-cloud-gcp-starter-pubsub. Is this on your radar to get upgraded or does anyone have a suggestion on upgrading?
    2 replies
    Nickolas Heckman
    @nrheckman

    Running a set of spring cloud stream applications. Seeing some exceptions when publishing messages to PubSub as part of a data processing stream.

    com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: The request contains an attribute key that is not valid (key=googclient_deliveryattempt). Attribute keys must be non-empty and must not begin with 'goog' (case-insensitive).

    I'm not explicitly assigning this attribute, so I can only imagine it's getting assigned to the output message via inheritance from the input message?

    20 replies
    William S Johnstone III
    @wjohnst3
    Hey all, I have a SpringBoot app using cloud GCP to connect to PubSub. Everything is impl in Reactor, life is good. I see that GCP is using an async pull with a poller. I see in Google's docs that they use a different model, they use streaming (https://cloud.google.com/pubsub/docs/pull#java_4). I'm wondering (if anyone knows) why does GCP poll and not stream? The reason I am asking is that I am adding pubsub pull subscriptions to another non-spring project, and i'm using streaming as per Google's doc. I have noticed a large increase in CPU.
    9 replies
    Aakash Giri
    @0APOCALYPSE0
    Hi, I am new to GCP firestore. I created the spring boot application to communicate with firestore using FirestoreReactiveRepository. I want to use @ServerTimestamp annotation in my POJO class so it can populate the lastModified property with server time automatically because of the annotation I am using. But @ServerTimestamp annotation not working as expected and I am getting null value in firestore document. I don't know what I am doing wrong.
    @Document(collectionName = "users")
            public class User {
                     @DocumentId
                     private String documentId;
                     @ServerTimestamp
                     private Date lastModified;
                     public User() {
                     }
    
                    public String getDocumentId() {
                return documentId;
                }
    
                public void setDocumentId(String documentId) {
                this.documentId = documentId;
                }
    
                     @PropertyName("last_modified")
                 public Date getLastModified() {
                 return lastModified;
                 }
    
               @PropertyName("last_modified")
                   public void setLastModified(Date lastModified) {
                this.lastModified = lastModified;
                }
         }
    5 replies
    hesp
    @nistelroj_twitter

    Hi. I have a Spring Boot application deployed on Google Clod Platform and want to use Google Trace service for tracing. I use the following libraries:

    - org.springframework.cloud:spring-cloud-starter-sleuth
    - com.google.cloud:spring-cloud-gcp-starter-trace
    - com.google.cloud:spring-cloud-gcp-starter-logging

    and in configuration I have:

    spring.sleuth.enabled=true
    spring.sleuth.propagation.type=B3
    spring.sleuth.sampler.probability=1.0
    spring.cloud.gcp.core.enabled=true
    spring.cloud.gcp.logging.enabled=true
    spring.cloud.gcp.trace.enabled=true

    Although I have sampler probability = 1.0 and don't see all request sampled on GCP Trace List page. Could someone explain me what is the Google Trace logic, in which conditions GCP will do sampling? Can I somehow in configuration force sampling?

    Thank you.

    14 replies
    Hugo Barrigas
    @hfgbarrigas

    hello, what's the best way to parse tracing data from the http request body? For reactor and servlet based servers.

    Use case: we're leveraging pubsub push subscriptions which don't add any request headers, pubsub template already puts tracing data as message attributes.

    17 replies