Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Violeta Georgieva
@violetagg
@benitocm I think you have to request that feature from Spring Framework
but they have to use this
benitocm
@benitocm
@violetagg Thanks. That makes sense. When I had a look to the code I saw that that there is an api to workaround that but it was not been used. Thanks for the confirmation
@violetagg First I will post this in the spring framework for confirmation about how to proceed
Violeta Georgieva
@violetagg
ok
benitocm
@benitocm
@violetagg Sorry for this question but it seems that there was a ticket related to this reactor/reactor-netty#223
Violeta Georgieva
@violetagg
yes that was the ticket
benitocm
@benitocm
@violetagg but the ticket is closed I dont undertsand
Violeta Georgieva
@violetagg
@benitocm checking why Spring Framework’s issue was closed
benitocm
@benitocm
@violetagg Ok, waiting for your feedback
Brian Clozel
@bclozel
It seems it's been addressed in spring-projects/spring-framework@288a9ec
you can change the frame size on the session itself
Violeta Georgieva
@violetagg
:+1:
benitocm
@benitocm
@bclozel @violetagg I will check
benitocm
@benitocm
@bclozel In a previous message, I shared more details about the system I was working. We had a high handshake time in a ssl websocket connection and I was trying to do a pool of them
@bclozel Do you have any ideas about how we can manage it?
Brian Clozel
@bclozel
@benitocm No. Given the nature of the websocket protocol, I think the connection is really the session, since you can multiplex messages over a session. If I'm not mistaken, it wouldn't even make sense to try and implement connection pooling for websocket connections.
In the case of HTTP1.1, we're using pipelining and head of line blocking to borrow/free a connection from a pool
Maybe @violetagg has a better understanding than me
benitocm
@benitocm
@bclozel Thanks.
benitocm
@benitocm
@bclozel I have checked the 288a9ec@spring- and it is not clear to me how I can inject a value for maxFramePayloadLength
Brian Clozel
@bclozel

@benitocm Rossen reached out and said:

it can also be set once for all sessions through the ReactorRequestUpgradeStrategy which can be configured like this https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-websocket-server-config

Chris Phillipson
@pacphi
hi all. i am employing the https://github.com/cloudfoundry/cf-java-client to create a service that will do a little cf house-keeping, looking for stopped app instances and orphaned service instances. i am stuck on some implementation and need a little help reasoning about why it’s not doing what i expect. if you would care to look here: https://github.com/pacphi/cf-butler/blob/master/src/main/java/io/pivotal/cfapp/task/AppPolicyExecutorTask.java#L106. i’ll try to explain what’s going on. first we iterate the application policies. we filter on policies where a flag for deleting service instances in addition to stopped app instances they were bound to. we filter again ignoring app instances and services instances in the black list. then we look for all occurrences of app instances bound to service instances (i.e., app relationships) and compile a list. we take that list and first unbind service instances from app instances. then delete the app instances and then delete the service instances. what’s happening in my tests is that logic seems to work fine until line 125. Unbind happens and app is deleted. but then the historical record (of that action) is not saved. (the historical_record repo impl works fine separately). and it never continues to delete the service instance. is there some refinement/improvment i can make to the logic to get it to work? happy to make attribution. this is an open-source project.
peter royal
@osi
@pacphi starting on line 113 you’re building the appRelationships list, and subscribing on line 121
but is that guaranteed to have completed by the time it’s used on line 123?
(and line 130)
why not turn it into a single flux, doing a collectList on line 121, and then doing the two branches in reaction to that?
i’d have the method return Mono<Void> instead of void
Chris Phillipson
@pacphi
good idea.
peter royal
@osi
(i’m pulling the code down to massage it into what i’m suggesting)
Chris Phillipson
@pacphi
i have had to update both implementations of deleteApplication to be more like what happens in unbindServiceInstance. The cf-java-client calls for delete and unbind return Mono<Void> mapping was not happening in deleteApplication to return a HistoricalRecord. so that part solved.
peter royal
@osi
protected Mono<Void> deleteApplicationsWithServiceBindingsAndDeleteBoundServiceInstances() {
        // these are the applications with service bindings
        // in this case the application policy has been configured with delete-services = true
        // so we:  a) unbind one or more service instances from each application, b) delete each application, 
        // and c) delete each formerly bound service instance
        return policiesService
                   .findAll()
                   .flux()
                   .flatMap(p -> Flux.fromIterable(p.getApplicationPolicies()))
                   .filter(ApplicationPolicy::isDeleteServices)
                   .flatMap(ap -> appInfoService.findByApplicationPolicy(ap, true))
                   .filter(bl -> !settings.getOrganizationBlackList().contains(bl.getOrganization()))
                   .flatMap(ar -> appRelationshipService.findByApplicationId(ar.getAppId()))
                   .collectList()
                   .flatMap(appRelationships -> Flux.fromIterable(new ArrayList<>(appRelationships))
                                                    .flatMap(this::unbindServiceInstance)
                                                    .distinct()
                                                    .flatMap(this::deleteApplication)
                                                    .flatMap(historicalRecordService::save)
                                                    .then(Flux.fromIterable(new ArrayList<>(appRelationships))
                                                              .flatMap(this::deleteServiceInstance)
                                                              .flatMap(historicalRecordService::save)
                                                              .then()
                                                    ));
    }
Chris Phillipson
@pacphi
but yes, i need to update the logic in deleteApplicationsWithServiceBindingsAndDeleteBoundServiceInstances to have it flow.
thanks @osi, that’s just what i need
peter royal
@osi
no problem!
(in general, try to go through and kill all the subscribe calls in favor of chaining Flux/Mono’s together)
and only subscribe at the edge
Chris Phillipson
@pacphi
Yup. Will take that on in increments.
peter royal
@osi
:+1:
benitocm
@benitocm
Hi guys, any link or reference where the context feature is explained with real examples? Thanks very much in advance
peter royal
@osi
@benitocm did you check the reference docs? https://projectreactor.io/docs/core/release/reference/#context
benitocm
@benitocm
@osi Yes, of course but I am not able to grasp correctly.
peter royal
@osi
I think they tried to provide a real example in 8.8.5 with the HTTP request example - can you elaborate more on where you’re getting stuck?
benitocm
@benitocm
@osi I have some kind of values in my flux that are generated in the middle and I am trying to check if I can use the context feature to make available those values to the rest of the flux
peter royal
@osi
I don’t think the context feature was intentend for that type of use case - when I’ve needed to do that I tend to use flatMap to capture the values into fields and use that to pass downstream (if they’re separate from the data stream in the remainder of the flux)
benitocm
@benitocm
@osi In my case one of the values generated in the middle is a sessionId that I would like to use in other part of the flux to log.
Nasibulloh
@Nasibulloh
@Nasibulloh
Hi everyone. When I use "@WebFluxTest" it required jpaAudintingHandler bean and use "@AutoConfigureDataJpa" everything is worked well, but when I sent request toController via WebClientTest I got error in the Controller bean. Because there were some dependencies in the Controller,a service class, there was a Repository interface in the Service class . Service class returned null pointer exception
I dont know why did it happen? I used @MockBean for Dependencies
Chris Phillipson
@pacphi
@osi thanks for the earlier assistance. however, i’m still not seeing results i expect. in the meanwhile AppPolicyExecutor task has been updated to be https://github.com/pacphi/cf-butler/blob/master/src/main/java/io/pivotal/cfapp/task/AppPolicyExecutorTask.java. i defered subscribe calls to the edge. sometimes i see apps with service bindings getting unbound and removed but not continuing to persist historical record or further executing service instance removal. see deleteApplicationsWithServiceBindingsAndDeleteBoundServiceInstances() method impl. any suggestions appreciated. ;)