{"id":1675,"date":"2016-01-09T10:53:50","date_gmt":"2016-01-09T05:23:50","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=1675"},"modified":"2016-01-19T16:51:49","modified_gmt":"2016-01-19T11:21:49","slug":"sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6\/","title":{"rendered":"Sending notifications via Apple&#8217;s new HTTP\/2 API (using Jetty 9.3.6)"},"content":{"rendered":"<p>HTTP\/2 is still very much new to Java, and as such, there are just two libraries who support it &#8211; Jetty (from 9.3), and Netty (in alpha). If you&#8217;re going the Jetty way (as I have), you&#8217;ll need to add their ALPN library to your boot classpath.<\/p>\n<p><strong>Note:<\/strong> Jetty 9.3.x requires the use of Java 8.<\/p>\n<p>A full library for this is available <a href=\"https:\/\/github.com\/CleverTap\/apns-http2\">here, on GitHub<\/a>.<\/p>\n<p>Here&#8217;s a quick example:<\/p>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist29832825\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-main-java\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-java  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"Main.java content, created by judepereira on 05:20AM on January 09, 2016.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"Main.java\">\n<tr>\n<td id=\"file-main-java-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-main-java-LC1\" class=\"blob-code blob-code-inner js-file-line\">package com.judepereira.jetty.apns.http2;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-main-java-LC2\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-main-java-LC3\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.client.HttpClient;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-main-java-LC4\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.client.api.ContentResponse;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-main-java-LC5\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.client.api.Request;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-main-java-LC6\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.client.util.StringContentProvider;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-main-java-LC7\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.http2.client.HTTP2Client;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-main-java-LC8\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n<td id=\"file-main-java-LC9\" class=\"blob-code blob-code-inner js-file-line\">import org.eclipse.jetty.util.ssl.SslContextFactory;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n<td id=\"file-main-java-LC10\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n<td id=\"file-main-java-LC11\" class=\"blob-code blob-code-inner js-file-line\">import java.io.FileInputStream;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n<td id=\"file-main-java-LC12\" class=\"blob-code blob-code-inner js-file-line\">import java.security.KeyStore;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n<td id=\"file-main-java-LC13\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n<td id=\"file-main-java-LC14\" class=\"blob-code blob-code-inner js-file-line\">public class Main {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n<td id=\"file-main-java-LC15\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n<td id=\"file-main-java-LC16\" class=\"blob-code blob-code-inner js-file-line\">    public static void main(String[] args) throws Exception {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n<td id=\"file-main-java-LC17\" class=\"blob-code blob-code-inner js-file-line\">        HTTP2Client http2Client = new HTTP2Client();<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n<td id=\"file-main-java-LC18\" class=\"blob-code blob-code-inner js-file-line\">        http2Client.start();<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n<td id=\"file-main-java-LC19\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n<td id=\"file-main-java-LC20\" class=\"blob-code blob-code-inner js-file-line\">        KeyStore ks = KeyStore.getInstance(&quot;PKCS12&quot;);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n<td id=\"file-main-java-LC21\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n<td id=\"file-main-java-LC22\" class=\"blob-code blob-code-inner js-file-line\">        \/\/ Ensure that the password is the same as the one used later in setKeyStorePassword()<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n<td id=\"file-main-java-LC23\" class=\"blob-code blob-code-inner js-file-line\">        ks.load(new FileInputStream(&quot;MyProductionOrDevelopmentCertificate.p12&quot;), &quot;&quot;.toCharArray());<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n<td id=\"file-main-java-LC24\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L25\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n<td id=\"file-main-java-LC25\" class=\"blob-code blob-code-inner js-file-line\">        SslContextFactory ssl = new SslContextFactory(true);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L26\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n<td id=\"file-main-java-LC26\" class=\"blob-code blob-code-inner js-file-line\">        ssl.setKeyStore(ks);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L27\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n<td id=\"file-main-java-LC27\" class=\"blob-code blob-code-inner js-file-line\">        ssl.setKeyStorePassword(&quot;&quot;);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L28\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n<td id=\"file-main-java-LC28\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L29\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n<td id=\"file-main-java-LC29\" class=\"blob-code blob-code-inner js-file-line\">        HttpClient client = new HttpClient(new HttpClientTransportOverHTTP2(http2Client), ssl);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L30\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n<td id=\"file-main-java-LC30\" class=\"blob-code blob-code-inner js-file-line\">        client.start();<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L31\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n<td id=\"file-main-java-LC31\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L32\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n<td id=\"file-main-java-LC32\" class=\"blob-code blob-code-inner js-file-line\">        \/\/ Change the API endpoint to api.development.push.apple.com if you&#39;re using a development certificate<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L33\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n<td id=\"file-main-java-LC33\" class=\"blob-code blob-code-inner js-file-line\">        Request req = client.POST(&quot;https:\/\/api.push.apple.com&quot;)<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L34\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n<td id=\"file-main-java-LC34\" class=\"blob-code blob-code-inner js-file-line\">                \/\/ Update your :path &quot;\/3\/device\/&lt;your token&gt;&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L35\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n<td id=\"file-main-java-LC35\" class=\"blob-code blob-code-inner js-file-line\">                .path(&quot;\/3\/device\/b2482deaf55521b2ccd755d5817a39784cc0044e24s3523a4708c2fa08983bdf&quot;)<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L36\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n<td id=\"file-main-java-LC36\" class=\"blob-code blob-code-inner js-file-line\">                .content(new StringContentProvider(&quot;{ \\&quot;aps\\&quot; : { \\&quot;alert\\&quot; : \\&quot;Hello\\&quot; } }&quot;));<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L37\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n<td id=\"file-main-java-LC37\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L38\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n<td id=\"file-main-java-LC38\" class=\"blob-code blob-code-inner js-file-line\">        ContentResponse response = req.send();<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L39\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"39\"><\/td>\n<td id=\"file-main-java-LC39\" class=\"blob-code blob-code-inner js-file-line\">        System.out.println(&quot;response code: &quot; + response.getStatus());<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L40\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"40\"><\/td>\n<td id=\"file-main-java-LC40\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L41\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"41\"><\/td>\n<td id=\"file-main-java-LC41\" class=\"blob-code blob-code-inner js-file-line\">        \/\/ The response body is empty for successful requests<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L42\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"42\"><\/td>\n<td id=\"file-main-java-LC42\" class=\"blob-code blob-code-inner js-file-line\">        System.out.println(&quot;response body: &quot; + response.getContentAsString());<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L43\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"43\"><\/td>\n<td id=\"file-main-java-LC43\" class=\"blob-code blob-code-inner js-file-line\">    }<\/td>\n<\/tr>\n<tr>\n<td id=\"file-main-java-L44\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"44\"><\/td>\n<td id=\"file-main-java-LC44\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/judepereira\/84f22fdf67ed6dd4d7d3\/raw\/bc19806e238a54bb183aad0cd8cd857ca3c9f825\/Main.java\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/judepereira\/84f22fdf67ed6dd4d7d3#file-main-java\" class=\"Link--inTextBlock\"><br \/>\n          Main.java<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTTP\/2 is still very much new to Java, and as such, there are just two libraries who support it &#8211; Jetty (from 9.3), and Netty (in alpha). If you&#8217;re going the Jetty way (as I have), you&#8217;ll need to add their ALPN library to your boot classpath. Note: Jetty 9.3.x requires the use of Java [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52,528],"tags":[548,551,550,549,553,552],"class_list":["post-1675","post","type-post","status-publish","format-standard","hentry","category-code","category-ios","tag-apns","tag-apple","tag-http2","tag-jetty","tag-notifications","tag-push"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-r1","jetpack-related-posts":[{"id":1685,"url":"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/","url_meta":{"origin":1675,"position":0},"title":"Compile LESS on the fly for your exploded WAR in IntelliJ","author":"Jude Pereira","date":"February 5, 2016","format":false,"excerpt":"At CleverTap, we've recently started using LESS for dynamic CSS. While it has it's upsides, the biggest downside\u00a0was that most of our developers couldn't use the hot deploy feature for their local deployments. After an hour or so, we came up with a neat solution. \u00a0 There are two parts\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"External Tool configuration for compiling LESS files before deployment","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1713,"url":"https:\/\/judepereira.com\/blog\/a-letter-to-tim-cook-regarding-ios-10-with-love-for-apple\/","url_meta":{"origin":1675,"position":1},"title":"A letter to Tim Cook regarding iOS 10, with love for Apple","author":"Jude Pereira","date":"June 17, 2016","format":false,"excerpt":"Tim, iOS has always been known for it's user interface, until recently. Your new take on notifications have not only made them very loud, and unsettling, but do not flow with the entire look and feel of Apple: No Mr. Tim, no. My notifications aren't waiting for me. They're crying\u2026","rel":"","context":"In &quot;life!&quot;","block_context":{"text":"life!","link":"https:\/\/judepereira.com\/blog\/category\/living-a-wonder\/"},"img":{"alt_text":"No Mr. Tim, no. My notifications will not be waiting for me. They're crying out for my attention.","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1824,"url":"https:\/\/judepereira.com\/blog\/java-9s-httpclient-doesnt-allow-custom-http-2-authorization-headers\/","url_meta":{"origin":1675,"position":2},"title":"Java 9&#8217;s HttpClient doesn&#8217;t allow custom HTTP\/2 authorization headers","author":"Jude Pereira","date":"January 23, 2018","format":false,"excerpt":"TL;DR Java 9 HttpClient does not allow custom Authorization header unless you resort to a hack. Read more about my blog post on CleverTap's blog.","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1845,"url":"https:\/\/judepereira.com\/blog\/intellij-on-steroids-with-g1-gc\/","url_meta":{"origin":1675,"position":3},"title":"IntelliJ on steroids with G1 GC","author":"Jude Pereira","date":"June 15, 2018","format":false,"excerpt":"Lately, I noticed that IntelliJ started to pause for quite some time during it's GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who's default garbage\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1936,"url":"https:\/\/judepereira.com\/blog\/taming-a-throttled-api-with-dynamic-proxies-in-java\/","url_meta":{"origin":1675,"position":4},"title":"Taming a throttled API with Dynamic Proxies in Java","author":"Jude Pereira","date":"January 20, 2021","format":false,"excerpt":"Recently, at CleverTap, we've begun migrating some of our largest clusters to a new protocol (for starters, think ~115 instances at a time). One of the most fun things I've had my hands on during this migration was the AWS Systems Manager API. When we scaled up our migrations gradually\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1616,"url":"https:\/\/judepereira.com\/blog\/0f-float-min_value-false\/","url_meta":{"origin":1675,"position":5},"title":"0f > Float.MIN_VALUE = false!","author":"Jude Pereira","date":"April 23, 2015","format":false,"excerpt":"Updates: Turns out that this is the expected behaviour from the java doc: A constant holding the smallest positive nonzero value of type float, 2-149. So now, how do I get the smallest negative value that a float can hold? Just came across the most weirdest thing ever in Java\u2026","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=1675"}],"version-history":[{"count":6,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1675\/revisions"}],"predecessor-version":[{"id":1682,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1675\/revisions\/1682"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=1675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=1675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=1675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}