Comments (6)
You showed some concerns on the original PR with doing this kind of low level resource manipulation at Spring initialization time. Do you not feel the same way anymore?
from spring-cloud-gcp.
Well, my point is about distinguishing new Subscriber()
and start()
if that is possible.
Otherwise I will live with the new instance each time the start()
is called.
"level resource manipulation" is a connection to the target service and it really must not happen in the new
or in the afterPropertiesSet()
.
But if Subscriber
is robust to stop/start
, and is really lightway at the moment of instantiation, we really can move it into the afterPropertiesSet()
as one-to-one relationship with enclosing PubSubInboundChannelAdapter
.
Does it make sense to you now?
from spring-cloud-gcp.
Yes, I understood you wanted to cache the Subscribers (and possibly the Publishers
too?), but MessageProducerSupport
doesn't implement afterPropertiesSet()
.
I'm thinking of checking if the subscriber already exists on doStart()
. If it does and is running, do nothing, if it isn't running, start it, if it doesn't exist, create a new one. I'm testing stopping/starting a Subscriber
, but running into some deadlocks. Need to investigate more.
from spring-cloud-gcp.
Quoting this issue description:
Therefore
Subscriber.defaultBuilder()
should be done from theonInit()
.
That onInit()
is called from the super.afterPropertiesSet()
. No need to fight with the state in the doStart()
.
from spring-cloud-gcp.
Starting, then stopping, then starting the same Subscriber
doesn't work, since it keeps its internal state and won't restart. I think that's because when Subscriber
is closed, it closes all its connections, so there isn't an advantage on restarting the same Subscriber
vs just creating a new one.
WDYT @artembilan ?
from spring-cloud-gcp.
Thank you for the investigation, @joaoandremartins !
Closing since it does not make sense work as designed.
from spring-cloud-gcp.
Related Issues (20)
- Spanner Lazy Loading seems not to be working HOT 1
- SpannerOperations.executeDmlStatement doesn't run Partitioned-DML when it's not performed in transaction. HOT 4
- java.net.MalformedURLException: unknown protocol: gs HOT 7
- PubSubBinderConfiguration is not disabled when PubSub is disabled HOT 1
- Unknown Function Lower or LOWER HOT 2
- Could not find an appender named [STACKDRIVER] HOT 2
- spring-cloud-gcp-starter-sql-postgresql - Connection issue HOT 1
- datastore: BeforeDeleteEvent is not fired if deletion was performed inside of performTransaction method HOT 1
- Traces not propagated to Cloud Trace, StackdriverTraceAutoConfiguration fails with timeout HOT 6
- Is there an equivalent of resilience4j for node.js HOT 1
- Backport SpannerOptions customizer HOT 2
- Could not autowire. No beans of 'PubSubPersonGateway' type found issue in Pub Sub Sample project HOT 4
- Huge amount of ScheduledFutureTask in memory in case pubsub.googleapis.com isn't available HOT 7
- Spring Boot the property spring.jpa.show-sql doesn't work with Datastore HOT 1
- Health Indicator for Cloud Spanner HOT 2
- pubSubHeathContributor timeout exception on start up. HOT 1
- Google Cloud Storage encoded-key problem HOT 3
- X-B3-TraceId different from x-cloud-trace-context HOT 2
- spring-cloud-gcp-starter-pubsub fail on enforcer plugin HOT 1
- springcloud-gcp-starter-pubsub can's sbscribe topic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-cloud-gcp.