Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 03 2018 11:28
    marcinczeczko labeled #402
  • Apr 03 2018 11:28
    marcinczeczko labeled #402
  • Apr 03 2018 11:28
    marcinczeczko milestoned #402
  • Apr 03 2018 11:28
    marcinczeczko milestoned #402
  • Apr 03 2018 11:27
    marcinczeczko opened #402
  • Apr 03 2018 11:27
    marcinczeczko opened #402
  • Apr 03 2018 11:19
    marcinczeczko commented #396
  • Apr 03 2018 11:18
    marcinczeczko edited #396
  • Apr 03 2018 11:18
    marcinczeczko edited #396
  • Apr 03 2018 11:17

    marcinczeczko on 398-config-defaults

    (compare)

  • Apr 03 2018 11:17

    marcinczeczko on backpressure-and-configs

    Reorganized standaolone & examp… Merge branch 'milestone/backpre… Set a version of target release and 16 more (compare)

  • Apr 03 2018 11:17
    marcinczeczko closed #400
  • Apr 03 2018 07:49
    marcinczeczko synchronize #400
  • Apr 03 2018 07:49

    marcinczeczko on 398-config-defaults

    Set target version for this bra… Merge branch 'milestone/backpre… (compare)

  • Apr 03 2018 07:48

    marcinczeczko on backpressure-and-configs

    Set target version for this bra… (compare)

  • Apr 03 2018 07:44
    marcinczeczko closed #398
  • Apr 03 2018 07:44
    marcinczeczko closed #398
  • Apr 03 2018 07:44
    marcinczeczko commented #398
  • Apr 03 2018 07:40
    marcinczeczko synchronize #400
  • Apr 03 2018 07:40

    marcinczeczko on 398-config-defaults

    Documentation fix. #394 Added encoding of uri para… Write a test case for requestin… and 5 more (compare)

Szymon Nowka
@nowszy94
Does knot'x provides some additional handlebars helpers? I know i could write my own extension, but maybe knotx already provides it.
Tomasz Michalak
@tomaszmichalak
only default helpers
Tomasz Michalak
@tomaszmichalak
Cognifide/knotx#253
Maciej Laskowski
@Skejven
you may create custom handlebars helper
Tomasz Michalak
@tomaszmichalak
performance issue: Cognifide/knotx#256
we plan to fix it in 1.0.0 release
Tomasz Michalak
@tomaszmichalak
new PR connected with Jsoup usage optimisation (tests before planned changes): Cognifide/knotx#257
Tomasz Michalak
@tomaszmichalak
merged: Cognifide/knotx#255
merged: Cognifide/knotx#257
Tomasz Michalak
@tomaszmichalak
Cognifide/knotx#261, approve please
Maciej Laskowski
@Skejven
@Marcin - this is ok
this is a part of APL license
Pawel
@pawelkoper
Hey could you tell me what is the option to see the "envelopes" of http packets sent by knotx?
Marcin Czeczko
@marcinczeczko
give me sec

For instance, on the adapter verticle, add option logActivity: true on clientOptions object, as follows

 "options": {
    "config": {
        "clientOptions": {
              ...
              "logActivity": true
         }
     }
}

then in logback.xml set DEBUG level for netty handler:

<logger name="io.netty.handler.logging" level="DEBUG"
        additivity="false">
  <appender-ref ref="STDOUT"/>
</logger>
Pawel
@pawelkoper
thanks!
Karol Drazek
@karoldrazek
Hey guys - does current knotx version support safe shutdown? I mean something that waits to serve all remaining requrest until it’s gonna go down.
Marcin Czeczko
@marcinczeczko
Currently not, but it's very doable with what we have. So please raise github issue so we will do this in next version
Tomasz Michalak
@tomaszmichalak
nice tutorial about the integration with REST service: http://knotx.io/hello-rest-service/
Tomek Niedźwiedź
@toniedzwiedz
Is it possible to refer to the query string or form parameters inside a Template?
I tweaked the REST service example to support filtering by a keyword provided by the user and added an option to limit the number of results by means of an HTML form present on the same page. I'd like to display this metadata but the response from the Google Books API doesn't contain it and I don't know of a way to access it in Knot.x itself.
Maciej Laskowski
@Skejven

Is it possible to refer to the query string or form parameters inside a Template?

@toniedzwiedz it is not possible currently to access query parameters inside the template, however you have full access to query parameters inside Adapter via ClientRequest object

in template, you can operate over _result (contains data from service call) and _response (contains service response metadata, as e.g. status code) scopes

Maciej Laskowski
@Skejven
If I understand correctly, the solution for this problem now is creating a custom adapter that will return query parameters within _result scope.
Maybe it is a good idea for an improvement, to enrich metadata by e.q. _request with request parameters - guys what do you think?
Tomek Niedźwiedź
@toniedzwiedz
Moving to GitHub Pages I see :)
Tomasz Michalak
@tomaszmichalak
yes that's the plan :)
this movement simplfies a lot of things like: reviews, collaboration etc
Tomek Niedźwiedź
@toniedzwiedz
Indeed
Tomasz Michalak
@tomaszmichalak
I hope you like it :)
Tomek Niedźwiedź
@toniedzwiedz
Also, everyone gets #FakeInternetPoints :sparkles:
Marcin Czeczko
@marcinczeczko
Finally we will be able to collaborate on website content 😊
Leo D'Angelo
@ldangelo
Does knotx support jrebel? I've setup jrebel for the example application. However, when I modify simple.html the page is not getting updated?
Marcin Czeczko
@marcinczeczko
Hi Leo. We are not supporting jrebel now. I think it's worth to take a look. However this
Leo D'Angelo
@ldangelo
Thanks @marcinczeczko is this something I could look into? Any pointers on what would need to be done?
Marcin Czeczko
@marcinczeczko
However this is pretty niche case for use. Example app using templates from classpath which is never happen in normal usage of knotx
Leo D'Angelo
@ldangelo
Ah, that makes sense… Never thought about that.
Marcin Czeczko
@marcinczeczko
You can check our blog post with scenario that's closer to the real setup http://knotx.io/hello-rest-service/
Leo D'Angelo
@ldangelo
thanks @marcinczeczko I was actually just looking at that repository/tutorial. Thanks for the pointer.
Marcin Czeczko
@marcinczeczko
No prob
Leo D'Angelo
@ldangelo
I have a ‘use case’ that I’d like to validate with the group. I have a ‘template’ stored remotely. I’d like to pull the template using a remote repository and then insert a customer specific banner before displaying the page. Any advice on how I might accomplish this?
Leo D'Angelo
@ldangelo
I’m ‘thinking’ I can best accomplish the above with handlebars. Would this be the recommended approach?
Tomasz Michalak
@tomaszmichalak
Hi Leo, you can use handlbars to accomplish your task. Your 'use case' sounds like some kind of Targeting extension. Based on the request (cookies or some token in URL) you provide different banner - which can be simple image or full HTML block.
Tomasz Michalak
@tomaszmichalak

When we talk about the image there is no issue with handbars usage - you need to provide image url and description. Your service can responsd with:

{
  "banner": {
    "url": "http://domain/path_to_image",
    "description": "Some description"
  }
}

Then you can simply consume the service response in your html template (which is fetched from remote repository):

<script data-knotx-knots="services,handlebars"
   data-knotx-service="targetservice"
   type="text/knotx-snippet">
   <img src="{{_result.url}}" alt="{{_result.description}}"
</script>

Look at http://knotx.io/blog/hello-rest-service/ where you have nice step by step description.

Tomasz Michalak
@tomaszmichalak

If we talk about providing full HTML markup for your banner or other targeted component I recommend you to write dedicated extension (called Knot: https://github.com/Cognifide/knotx/wiki/Knot#how-to-implement-your-own-knot). It can call the targeting service which responds with HTML (not JSON) and then put it as fragment content (simply replace fragment markup). To be honest we have a similar solution in our plans. We have the dedicated repository for that extensions: https://github.com/Knotx/knotx-extensions.

Could you please create an issue in this repository and describe your use case in details. It will help us when we will prepare backlog for the next milestone.

Leo D'Angelo
@ldangelo
@tomaszmichalak Thank you for the response. I will create an issue in the backlog. You pretty much got the use case though. I will authenticate with oauth, the oauth implementation we use returns a companyid, based on the company id I will display a company specific banner (as well as some other company specific metrics). I’m going to store a ‘template’ in S3 and then use knotx to render the template. This is much less overhead than using a CMS as I don’t want to have to setup 40-90k individual configurations.
Tomasz Michalak
@tomaszmichalak
Nice, lets chech JWT tokens to keep an authentication data. It will boost your scaling options - you can then set up ELB in front of your Knot.x instances. Having Apache in front of Knot.x would be also useful to redirect all nonHTML request to content source
Knot.x can be easily scaled both verticaly and horizontaly (thanks event bus which can be clustered - Hazelcast)
Nice, lets chech JWT tokens to keep an authentication data. It will boost your scaling options - you can then set up ELB
Tomasz Michalak
@tomaszmichalak
@ldangelo do you have your endpoint with company data implemented? It can be also a part of Knot.x - you can connect directly do DB from Adapter. You omit one HTTP call. We plan to share new tutorial with similar solution this/next week.
Leo D'Angelo
@ldangelo
@tomaszmichalak no I don’t have the end point yet. I would love to see the tutorial. I was actually planning on submitting my solution to the community but I’m sure you guys will do it better than I.
Tomasz Michalak
@tomaszmichalak
It would be great to see