codependent

0

votes
1

answer
11

views

How does Spring Kafka/Spring Cloud Stream guarantee the transactionality / atomicity involving a Database and Kafka?

Spring Kafka, and thus Spring Cloud Stream, allow us to create transactional Producers and Processors. We can see that functionality in action in one of the sample projects: https://github.com/spring-cloud/spring-cloud-stream-samples/tree/master/transaction-kafka-samples: @Transactional @StreamListe...
codependent
1

votes
1

answer
435

views

Does Spring Security OAuth2 support Authorization Code Flow with PKCE for browser (Angular) clients?

Browser applications auth used to be managed using the Implicit grant of the Authorization Server. I successfully implemented this using Spring Security Oauth. This approach has several drawbacks: Refresh tokens are not supported, so when the token expires we need to reauthenticate with the Authoriz...
codependent
1

votes
2

answer
167

views

Micronaut serverless application using DynamoDB and Graal custom runtime throws Cannot construct instance of com.amazonaws.partitions.model.Partitions

SAMPLE PROJECT AVAILABLE HERE: https://github.com/codependent/micronaut-aws-lambda-proxy-graal I have a Micronaut application deployed on Amazon AWS as a Lambda function. It is compiled into a GraalVM native image and run using an AWS Lambda Custom Runtime. If the application doesn't use DynamoDB it...
codependent
1

votes
1

answer
19

views

Docker is deleting downloaded files during build when I use a VOLUME, why?

I have this simple Dockerfile: FROM fabric8/java-centos-openjdk8-jdk VOLUME /tmp RUN curl -k -Lo /tmp/oc.tar.gz 'https://mirror.openshift.com/pub/openshift-v3/clients/3.6.173.0.21/linux/oc.tar.gz' && ls -l /tmp RUN ls -l /tmp && tar zxf /tmp/oc.tar.gz -C /usr/local/bin It has to download a file, pri...
codependent
1

votes
1

answer
235

views

Why am I occasionally getting a InvalidStateStoreException PARTITIONS_REVOKED, not RUNNING when retrieving a store to query it?

I am accessing a state store to query it and have had to wrap the store() statement with a try/catch block to retry it because sometimes I am getting this exception: org.apache.kafka.streams.errors.InvalidStateStoreException: Cannot get state store customers-store because the stream thread is PARTIT...
codependent
1

votes
0

answer
37

views

Is it possible to get the configured OAuth2 scopes of an invoked endpoint in a WSO2 custom handler?

I have implemented a custom WSO2 handler to validate an externally generated JWT token that contains, among other things, the user scopes. During the handler execution I want to add another check: get the scope/scopes associated to the currently executed endpoint and validate that the JWT token cont...
codependent
1

votes
0

answer
33

views

Maven remote archetype from Nexus offers all snapshots instead of only the last one

I have generated a Maven archetype which has been uploaded to a Nexus repository (mvn deploy). This archetype is still a SNAPSHOT. When I try to generate a project mvn archetype:generate -DarchetypeCatalog=remote -U I am offered every uploaded SNAPSHOT, when I am only interested in the last one: 1:...
codependent
1

votes
2

answer
45

views

Is it possible to pause a stage until a time is reached in a Jenkins declarative pipeline?

I have a requirement to only allow deployments to production in a specific time range, e.g.: between 04:00 and 06:00. My Jenkins pipeline is triggered by a Git webhook and starts a flow consisting of the usual stages (Build, Test, Deploy Dev, Deploy Pre, Deploy Pro). When we reach the Deploy Pro sta...
codependent
1

votes
2

answer
25

views

Is there a way to change the default port (9443) of the token endpoint available for the JWT Grant?

The WSO2 offers, in the JWT Grant, an endpoint with the format https://WSO2_URL:9443/oauth2/token. Is there a way to change that port to 8243?
codependent
1

votes
0

answer
47

views

Graal native image calling https throws Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

I am generating a Graal native image that makes an https call. The problem is it throws an exception when trying to make the call: @Controller('/') public class ExampleController { private static final Log LOG = LogFactory.getLog(ExampleController.class); private ObjectMapper mapper = new ObjectMapp...
codependent
1

votes
1

answer
96

views

Can't create project in Google Cloud

I am trying to create a project in the Google Cloud Console but I can't associate it to a an organization: The list of organizations is empty. How can I create one?
codependent
1

votes
1

answer
62

views

Spring Cloud Function deployed on AWS Lambda fails with NullPointerException at FunctionalSpringApplication.java:102

I have a very simple Spring Cloud Functions with the AWS adapter to run it as an AWS Lambda. The source code is available on Github: https://github.com/codependent/spring-boot-authentication-function @SpringBootApplication class SpringBootAuthenticationFunctionApplication { @Bean fun kotlinSupplier(...
codependent
1

votes
1

answer
30

views

Multiple wildcard DNS values in an OpenShift cluster

The OpenShift installation manual details the use of a wildcard DNS that will be appended to the route URLs. It is setup in the Ansible hosts file, e.g: openshift_master_default_subdomain=cloud.myorg.com I have been working in several clients where, while there is only one OCP cluster, they have dif...
codependent
1

votes
1

answer
18

views

Verify low coverage of an Angular application in a Jenkins pipeline

When we want to verify the code coverage of a Java application we use jacoco to generate a .exec file and run a Jenkins jacoco step to enforce the validatio thresholds, e.g: def classPattern = '**/target/classes' def execPattern = '**/target/**.exec' def sourcePattern = '**/src/main/java' def covera...
codependent
1

votes
1

answer
45

views

Does Istio allow to configure a maximum response timeout for a circuit breaker to open? How?

I'm checking the documentation for the DestinationRule, where there are several examples of a circuit breaking configuration, e.g: apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: bookinfo-app spec: host: bookinfoappsvc.prod.svc.cluster.local trafficPolicy: connectionP...
codependent
2

votes
0

answer
17

views

OpenShift and Istio Gateway traffic configuration in order to access using an external a domain

After deploying Istio 1.1.2 on OpenShift there is an istio-ingressgateway route with its associated service and pod. I have successfully used that ingress gateway to access an application, configuring a Gateway and a VirtualService using * as hosts. However I would like to configure a domain, e.g in...
codependent
1

votes
1

answer
1.4k

views

Spring Data JPA + QueryDSL Query optimization

I have come across a weird behaviour when using QueryDSL integrated with Spring Data JPA: I have a ManyToOne relation between Project and Person. If I get all the projects belonging to a user by owner id (foreign key) everything works as expected: QProject project = QProject.project; QPerson owner =...
codependent
1

votes
1

answer
807

views

XAER_OUTSIDE Exception - Spring 4.0.3 - Hibernate 4.1.12 - JTA - Websphere 8 - DB2

EDIT - I have checked this combinations so it seems there's something wrong with Hibernate 4: Spring 4 + JPA + Hibernate 4 -> Exception Spring 4 + Hibernate 4 -> Exception Spring 4 + JPA + Hibernate 3 -> OK Spring 4 + Hibernate 3 -> OK Spring 3 + JPA - Hibernate 4 -> Exception Spring 3 + JPA - Hi...
codependent
1

votes
2

answer
141

views

Unable to modify and test a forked GitHub library - npm ERR! version not found

I am a noobie with all this Github forking-pull-request lifecycle. What I want to do is fork a repository, make some changes and try them on a project before submitting a pull request. I already forked the repo and modified it but I am not able to test it. Let's suppose I increased the version of t...
codependent
1

votes
1

answer
1.5k

views

Springfox not generating Swagger docs for Spring MVC Rest versioned API

We are facing our REST API versioning and after having read a lot about the different options (URI versioning, mime type versioning) have decided to use the latter approach. I was expecting that Springfox generates the following doc: v1: get /api/architecture/mails - application/vnd.arch.mails.v1+js...
codependent
1

votes
1

answer
2.5k

views

WSWS4104E: SOAP 1.2 protocol not supported by SAAJ 1.2

I have a JAXWS client in a standalone application that is throwing: Caused by: java.lang.UnsupportedOperationException: WSWS4104E: SOAP 1.2 Protocol is not supported by SAAJ 1.2. at com.ibm.ws.webservices.engine.xmlsoap.SOAPFactory.setSOAPConstants(SOAPFactory.java:143) at com.ibm.ws.webservices.eng...
codependent
1

votes
1

answer
146

views

Spring Boot - Why is MyFilter called many times in a single request when using Tiles+JSP?

Given this filter: public class MyFilter implements Filter{ @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { System.out.println('FILTERING!!!!!!!!!!!!!!!!!!!'+((HttpServletRequest)request).getRequestURI()); cha...
codependent
1

votes
2

answer
268

views

Serializing form with nested paths and arrays to JSON in javascript

A similar question is addressed here: Convert form data to JavaScript object with jQuery with the following solution: $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this.name] !== undefined) { if (!o[this.name].push) { o[this.name] = [o[th...
codependent
1

votes
1

answer
820

views

Spring Cloud Config Server - How to download binary file

I have a Spring Cloud Config Server with the usual properties files in the git repo: |--application.yml |--app1.yml I also added a binary file |--mybinaryfile Normally to access the properties I would ask for http://myconfigserver/app1/dev Is it possible to download the binaryfile through the confi...
codependent
1

votes
2

answer
1.3k

views

Hibernate java.lang.ClassCastException: _$$_javassist_856 cannot be cast to javassist.util.proxy.Proxy when using Websphere Shared Library

Websphere 8.0.0.11 Hibernate 4.2.21.Final I have found many questions about this same problem but none of them worked for me. If I deploy the application in Websphere it works OK. However we have defined a shared library that contains all the third party libraries (spring, hibernate, javassist, etc...
codependent
1

votes
1

answer
869

views

Jenkins 2 - How to get user role (Role Strategy Plugin) from Jenkins Workflow - Pipeline Plugin

I would like to access the user role/roles, configured in Role Strategy Plugin in a Jenkins 2 pipeline (workflow): node { // Get the user Role }
codependent
1

votes
1

answer
1.6k

views

Spring Security Oauth2 - InsufficientAuthenticationException: Authentication is required to obtain an access token (anonymous not allowed)

I am trying to understand why anonymous users in the client can't get an access token. I found this post on the Spring Blog regarding this topic, where Dave Syer answers this: Remember this is an issue to do with the client app, not the auth server, so try and see it from the point of view of the cl...
codependent
1

votes
1

answer
386

views

Spring 5 Web Reactive - Clarification about DTO response body conversion

According to the doc: The response body can be one of the following: Account — serialize without blocking the given Account; implies a synchronous, non-blocking controller method. How come a synchronous controller method can be non-blocking? It sounds like a contradiction.
codependent
1

votes
1

answer
877

views

Spring Cloud Stream Kafka - Eventual consistency - Does Kafka auto retry unacknowledged messages (when using autocommitoffset=false)

Implementing an eventually consistent distributed architecture has turned out to be a pain. There are tons of blog posts telling stories about how to do it, but not showing (code) how to actually do it. One of the aspects I'm suffering is having to deal with manual retries of the messages when they...
codependent
1

votes
2

answer
2.1k

views

How to configure a Jenkins 2 Pipeline so that Jenkinsfile uses a predefined variable

I have several projects that use a Jenkinsfile which is practically the same. The only difference is the git project that it has to checkout. This forces me to have one Jenkinsfile per project although they could share the same one: node{ def mvnHome = tool 'M3' def artifactId def pomVersion stage('...
codependent
1

votes
1

answer
448

views

Apache Kafka Streams Interactive Queries - How to create a store where the value is an entity and not an aggregation

I have a topic which receives events with the following info: key -> orderId (Integer) value -> {'orderId' : aaa, 'productId' : xxx, 'userId' : yyy, 'state' : 'zzz'} (JSON with the whole info of the order) I want to implement a interactive query to get the full order information by orderId. The idea...
codependent
1

votes
1

answer
1.1k

views

How to publish to Nexus the artifact generated by a Gradle project in Jenkins

I have a Gradle project with the following uploadArchives configuration to publish its artifact to Nexus: uploadArchives { repositories { mavenDeployer { repository(url: 'http://releasesrepo') snapshotRepository(url: 'http://snapshotsrepo') } } } As you see there are no credentials in this configura...
codependent
1

votes
1

answer
626

views

resilience4j How to handle errors when using a circuit breaker in a Spring webflux application

Right now when the circuit opens the connection is just kept open with no response. If I stop the server the browser shows: Whitelabel Error Page This application has no configured error view, so you are seeing this as a fallback. Wed Mar 14 12:55:08 CET 2018 There was an unexpected error (type=Int...
codependent
1

votes
1

answer
254

views

Is there a way to speed up the horizontal pod autoscaler metrics scan? Now it takes two minutes to upscale new pods

I have an application with some endpoints that are quite CPU intensive. Because of that I have configured a Horizontal Pod Autoscaler like this: spec: maxReplicas: 10 minReplicas: 1 scaleTargetRef: apiVersion: extensions/v1beta1 kind: DeploymentConfig name: some-app targetCPUUtilizationPercentage: 3...
codependent
1

votes
1

answer
419

views

Whats the difference between a resource limit and a resource max in Limit Range? And request vs min?

LimitRange allows us to configure these properties per resource (memory, CPU): Limit: default maximum ammount of the resource that will be provisioned. Request: default initial ammount of the resource that will be provisioned. However I just realized there are two other options, min and max. Since m...
codependent
1

votes
1

answer
0

views

Spring Webflux annotated rest controller doesn't support ServerHttpRequest as method parameter: java.lang.NoSuchMethodException

Spring Boot 2.1.0/1 application packaged as war doesn't support ServerHttpRequest as input parameter in a Rest Controller, e.g: @GetMapping(produces = APPLICATION_JSON_UTF8_VALUE) public Flux findAll(ServerHttpRequest request) { return eventService.findAll(); } Log: java.lang.IllegalStateException:...
codependent
1

votes
1

answer
0

views

How can we determine the request environment (sandbox / production) in a WSO2 custom handler?

I need to determine if a request is for a sandbox or production environment in a WSO2 custom handler? How can I get that information? public class CustomHandler extends AbstractHandler { @Override public boolean handleRequest(MessageContext messageContext) { //GET Environment info... Assume it is an...
codependent
1

votes
1

answer
0

views

How should the WSO2 API Manager process be managed and kept alive in production?

Wso2 has a .sh file to start it the API manager. Although the documentation is quite thorough it doesn’t specify how the wso2 process should be started and kept alive in an environment. Would a system service (system.d) be the recommended approach or is there another and more appropriate way to do...
codependent
1

votes
2

answer
0

views

Is there a way not to generate a refresh token in the WSO2 JWT Grant flow?

I am using JWT Grant to exchange a JWT token generated by an external Identity Provider for a WSO2 access token. The client that will do this is a public browser so I don't want to have a refresh_token. Is there way to configure WSO2 API Manager so that it doesn't generate a refresh_token?
codependent
1

votes
1

answer
3.7k

views

Unable to start logstash against elastic search (org.elasticsearch.transport.ReceiveTimeoutTransportException)

I am following the getting started guide from http://logstash.net/docs/1.4.2/tutorials/getting-started-with-logstash but I can't make it work against elasticsearch. My environment is Linux Fedora - logstash 1.4.2 - elasticsearch 1.1.1 I start elastic search and verify it's OK: [2015-01-16 11:12:33,0...
codependent

View additional