Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 21 04:33
    BalloonWen review_requested #934
  • Apr 21 04:33
    BalloonWen review_requested #934
  • Apr 21 04:33
    BalloonWen opened #934
  • Apr 21 04:31

    BalloonWen on #178-base-url

    issue light-rest-4j #178 - adde… (compare)

  • Apr 20 16:05
    stevehu commented #932
  • Apr 20 16:05

    stevehu on issue932

    (compare)

  • Apr 20 16:05
    stevehu closed #932
  • Apr 20 16:05

    stevehu on master

    fixes #932 make the health chec… (compare)

  • Apr 20 16:05
    stevehu closed #933
  • Apr 20 16:05
    stevehu opened #933
  • Apr 20 16:05

    stevehu on issue932

    fixes #932 make the health chec… (compare)

  • Apr 20 16:04
    stevehu opened #932
  • Apr 19 19:01
    stevehu commented #931
  • Apr 19 19:00
    stevehu closed #931
  • Apr 19 19:00

    stevehu on master

    fixes #931 add service.yml to t… (compare)

  • Apr 19 18:59
    stevehu opened #931
  • Apr 19 18:58
    stevehu commented #929
  • Apr 19 18:58

    stevehu on issue929

    (compare)

  • Apr 19 18:58
    stevehu closed #929
  • Apr 19 18:58

    stevehu on master

    fixes #929 add error codes for … (compare)

Steve Hu
@stevehu
LightProducer is an interface and it has several implementations. You choose the one you want to use and set it up in the service.yml
PeterKieu
@PeterKieu
One suggestion is that changing private to public method related to FlinkKafkaProducer on TransactionalProducer class
OK, flexible way is customize new one from LightProducer
Steve Hu
@stevehu
You can have your own implementation for the LightProducer.
PeterKieu
@PeterKieu
because the key topic is Kafka transaction, and we have a brand name TransactionalProducer, Some guys may be confused about mechanism of TransactionalProducer
Steve Hu
@stevehu
I use TransactionalProduce myself. It has all the features I need. But a lot of people want something simpler. So I create a handler trying to make the Kafka producer with the light-proxy. That means you can access the Kafka just like an API without worrying about the details.
PeterKieu
@PeterKieu
ok, I see, thanks.
Steve Hu
@stevehu
There are several kafka examples in the light-example-4j/kafka folder that might help.
PeterKieu
@PeterKieu
Thanks. I read that many times in a week, but you do not use transactional API, thus I should contribute another example, beside gradle codegen-tool branch.
Steve Hu
@stevehu
It is using the transactional API on the producer-consumer and stream-query.
PeterKieu
@PeterKieu
yes, I see you wrapper on Kafka streams having UserEventProcessor!
Steve Hu
@stevehu
the maproot is using Avro but and the events are defined in the light-portal which is not open sourced. However, the concept is easy to understand. To make it simple to understand, the light-example-4j/kafka is using JSON for the event. For real application, I would recommend Avro or Protobuf for the event.
Steve Hu
@stevehu
We have released 2.0.23 for jdk11 and 1.6.31 for jdk8. It is backward compatible with some defects addressed, and some enhancements added.
For more all the PRs included in each release, please visit https://trello.com/b/189msq9S/release-schedule or individual release note.
Steve Hu
@stevehu
@PeterKieu I remember you have asked how to merge multiple OpenAPI specification together and deployed it to the light-router or light-proxy but have issues with merging handler.yml automatically. Please take a look at this document at the end to use wildcard paths for the handler.yml file. One of our customers is using it this way. https://doc.networknt.com/style/light-aws-lambda/lambda-proxy/
PeterKieu
@PeterKieu
perfect, thanks!
PeterKieu
@PeterKieu
@stevehu For the light-kafka features, can we add a callback listener for receiving new stream key-value store by events, instead of polling to call stream key-value store.get()
PeterKieu
@PeterKieu
I sent an email to you of an example for a new light-kafka CQRS model based on transactional API. Pls verify that it can help our Light-4j community.
@stevehu can you give me your email?
PeterKieu
@PeterKieu
I am thinking to use GuavaCache which supports event hanlder and notification Or implement the java.util.Observer for this.
Steve Hu
@stevehu
my email is stevehu@gmail.com
I don't like Guava because it is too heavy. Also, if we use Kafka streams, there is a local rocksDB which is as fast as in memory database.
PeterKieu
@PeterKieu
I just want to control the response topic data in the same context of Producer.send(), e.g: future =producer.send(record ); ReadOnlyKeyValueStore<String, String> receiverStore = StartupHook.streams.getUserIdStore(); String data = receiverStore.get(idempotencyKey);
PeterKieu
@PeterKieu
May be using ObservableHashMap is light and enough for this
Steve Hu
@stevehu
I tried to understand your code in UserService. It looks like it is a producer, why do you use streams in the same class? In CQRS, the producer is the Command and the Streams are usually in the query side. Am I missing something?
Steve Hu
@stevehu
I did a performance test several days ago to use light-proxy as a sidecar. Hope it helps. https://doc.networknt.com/service/proxy/benchmark/
PeterKieu
@PeterKieu
Thanks Steve. I just finish solving the issue for CQRS example. I will push the code then you can see the interesting way there. One missing thing there, is to support Kafka partition. In UserService, it uses a stream to query the response topic then return to mobile app (edge REST client) in the same context, not as query side. Thus, traditional REST request/response can move to Kafka transaction in a same logic and high performance way.
Steve Hu
@stevehu
In Kafka streams, the partitions are allocated automatically and usually you should start the same number of instances as your partitions.
PeterKieu
@PeterKieu
Yes. I re-use your kafka-query example which includes concept of querying through partitions to get data.
PeterKieu
@PeterKieu
@stevehu Pls take a look at my update. I think that it may be better than the traditional CQRS model because Kafka supports data to edge modules for instance Queries anytime, and Transactional producer for exactly-once Commands, specially response result in the same command context.
We can standardize this Light Kafka-CQRS model, then apply for the codegen to simplify the CQRS model.
PeterKieu
@PeterKieu
For fire-and-forget Commands such as email/sms/task-scheduling, this model easily customizes
Steve Hu
@stevehu
We have released 2.0.24 for jdk11 and 1.6.32 for jdk8. It is backward compatible with some defects addressed, and some enhancements added.
For more all the PRs included in each release, please visit https://trello.com/b/189msq9S/release-schedule or individual release note.
PeterKieu
@PeterKieu
Many update for this release, Thanks much Steve
Steve Hu
@stevehu
Most updates are contributed or driven by our enterprise customers. We learned a lot from our users :)
Relivian
@Relivian
@stevehu What's the plan or intent for light-mobile-4j?
Steve Hu
@stevehu
@Relivian While starting with a mobile project recently, we realized that the API access between mobile and SPA are almost the same, so the light-spa-4j is suitable for the mobile security as well with OAuth 2.0 Authorization code flow.
The use cases for our own project is very limited. If you have some special requirement that light-spa-4j cannot meet, let's discuss it and make enhancement on it.
Relivian
@Relivian
@stevehu I wondered whether you want to port some of the middleware handlers you already have for the JDK to mobile platforms. In that case I wanted to ask you which ones you'd like to have ported.
Otherwise and as you already hinted, with React you're already pretty close to mobile platforms. Maybe I am wrong but I think I saw also services worker implementations on the light-4j platform that are needed for PWA's..
Relivian
@Relivian
I also don't really see the need for native mobile versions.
Steve Hu
@stevehu
The light-spa-4j is just one middleware handler with authentication and authorization for SPA and Mobile. It has to combined with other middleare handlers in the light-router to work. You can package/enable as many middleware handlers in the light-router based on your requirement.
PeterKieu
@PeterKieu
hi @stevehu. I got SSL handshake error on docker network driver: overlay
using driver: bridge or host SSL call running well. Do you know how to fix this? thanks much indeed
Steve Hu
@stevehu
Most likely it is missing certificate in the client.truststore if you are using the light-4j Http2Client. It can be easily debugged by following this article. https://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/ReadDebug.html
PeterKieu
@PeterKieu
Thanks much. I testes both Http2Client and OkHttpClient. The problem is due to Docker networking mode (host/bridge/overlay), overlay makes this error.
Steve Hu
@stevehu
I have done a benchmark and it might help if you want a comparison. https://github.com/networknt/http2client-benchmark
PeterKieu
@PeterKieu
Light http2client is still impressive in performance. However, in fact, we must call many http-servers (inc: HTTP/1.1 & 2.0, basic authen/OAuth2/xcesskey...) => OkHttpClient is somewhat more flexible. I used Http2Client for Light-4j API-API calls and OkHttpClient for 3rd-party calls
Vincent Lee
@kvneight:matrix.org
[m]
Hi ,friends. Where could I found an example of java8 ? I noticed the examples are all based on java11,but my evnironment only java8 available.
Steve Hu
@stevehu
light-example-4j 1.6.x branch contains all the examples for light-4j 1.6.x which is Java 8.
1 reply