File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
functions/helloworld/groovy-hello-pubsub/src/main/groovy/functions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.google.cloud.functions.BackgroundFunction
55import com.google.cloud.functions.Context
66import functions.eventpojos.PubSubMessage
77import java.nio.charset.StandardCharsets
8- import java.util.logging.Logger ;
8+ import java.util.logging.Logger
99
1010class GroovyHelloPubSub implements BackgroundFunction<PubSubMessage > {
1111 private static final Logger LOGGER = Logger . getLogger(GroovyHelloPubSub . class. name)
@@ -15,11 +15,11 @@ class GroovyHelloPubSub implements BackgroundFunction<PubSubMessage> {
1515 // name's default value is "world"
1616 String name = " world"
1717
18- if (message?. data != null ) {
19- name = new String (Base64 . getDecoder() . decode(message. data), StandardCharsets . UTF_8 )
18+ if (message?. data) {
19+ name = new String (Base64 . decoder . decode(message. data), StandardCharsets . UTF_8 )
2020 }
2121
22- LOGGER . info(String . format( " Hello %s! " , name) )
22+ LOGGER . info(" Hello ${ name } ! " )
2323 return
2424 }
2525}
You can’t perform that action at this time.
0 commit comments