<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Java on Felix Seifert</title>
		<link>https://felix-seifert.com/blog/tags/java/</link>
		<description>Recent content in Java on Felix Seifert</description>
		<generator>Hugo</generator>
		<language>en-gb</language>
		
		
		
			<copyright>Felix Seifert</copyright>
		
		
			<lastBuildDate>Sun, 11 Oct 2020 17:53:29 +0000</lastBuildDate>
		
			<atom:link href="https://felix-seifert.com/blog/tags/java/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Success at AI Hackathon With Traap</title>
				<link>https://felix-seifert.com/blog/success-at-ai-hackathon-with-java-application-traap/</link>
				<pubDate>Sun, 11 Oct 2020 17:53:29 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/success-at-ai-hackathon-with-java-application-traap/</guid>
				<description>&lt;figure&gt;&#xA;  &lt;img src=&#34;https://felix-seifert.com/images/posts/kthais-logo_hu_7f29636cd4a20715.webp&#34;&#xA;       &#xA;       srcset=&#34;https://felix-seifert.com/images/posts/kthais-logo_hu_38fd8c09f24c51f0.webp 640w, https://felix-seifert.com/images/posts/kthais-logo_hu_7f29636cd4a20715.webp 1034w&#34;&#xA;       sizes=&#34;(min-width: 42rem) 40rem, 100vw&#34;&#xA;       width=&#34;1034&#34; height=&#34;322&#34;&#xA;       alt=&#34;Logo of the AI Society at KTH Royal Institute of Technology&#34;&#xA;       fetchpriority=&#34;high&#34; decoding=&#34;async&#34;&gt;&lt;figcaption&gt;Logo of KTH AI Society&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Recently, I attended a hackathon of the &lt;a href=&#34;https://kthais.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;AI Society at KTH Royal Institute of Technology&lt;/a&gt; in Stockholm, Sweden. The boundaries of the topic choice were quite loosely defined and the organisers encouraged us to use artificial intelligence (AI). My eventual development can be found on &lt;a href=&#34;https://devpost.com/software/traap&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;DevPost&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;hackathon-process&#34;&gt;Hackathon Process&lt;/h2&gt;&#xA;&lt;p&gt;My team consisted out of two other developers and me. All of us had never developed any AI technology before. After an intensive brainstorming, we decided on a use case of analysing travel data with some machine learning algorithms. After several setbacks, including a crashed operating system which took up a significant amount of the hackathon time to work around, I decided to tackle our use case from another perspective. I programmed the whole night and came up with &lt;a href=&#34;https://devpost.com/software/traap&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Traap - the TRAvel mAP&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Internship as a DevOps Engineer in Tokyo</title>
				<link>https://felix-seifert.com/blog/internship-as-a-devops-engineer-in-tokyo/</link>
				<pubDate>Mon, 30 Sep 2019 14:40:21 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/internship-as-a-devops-engineer-in-tokyo/</guid>
				<description>&lt;figure&gt;&#xA;  &lt;img src=&#34;https://felix-seifert.com/images/posts/monitors-for-coding_hu_692e570557326ba1.webp&#34;&#xA;       &#xA;       srcset=&#34;https://felix-seifert.com/images/posts/monitors-for-coding_hu_14e86be5bffeca10.webp 640w, https://felix-seifert.com/images/posts/monitors-for-coding_hu_692e570557326ba1.webp 1000w&#34;&#xA;       sizes=&#34;(min-width: 42rem) 40rem, 100vw&#34;&#xA;       width=&#34;1000&#34; height=&#34;333&#34;&#xA;       alt=&#34;Internship in Tokyo, Japan as a DevOps Engineer&#34;&#xA;       fetchpriority=&#34;high&#34; decoding=&#34;async&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;In mid-June 2019, I started an internship with Bosch in Tokyo, Japan. Till mid-November, I am going to work as a DevOps Engineer taking care of the whole software development cycle from planning, analysis and design through to implementation, deployment and maintenance.&lt;/p&gt;&#xA;&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;&#xA;&lt;p&gt;Usually, internships in the field of software engineering are within a team consisting of at least one other developer. However, as I am interning in the Automotive Aftermarket department which mainly deals with sales, marketing and logistics, I am there as the only engineer. Fortunately, during my last internship for Bosch in Singapore, I picked up lots of skills needed not only for software development but also for organising your project within the Bosch group, so I had some ideas about the security restrictions and the proxy issues.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Limit and Offset in Spring Data JPA</title>
				<link>https://felix-seifert.com/blog/limit-and-offset-spring-data-jpa-repositories/</link>
				<pubDate>Sun, 14 Jul 2019 13:29:21 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/limit-and-offset-spring-data-jpa-repositories/</guid>
				<description>&lt;p&gt;Limit and offset are two properties often requested for requesting data out of a database. Implementing them with a SQL query is also not that difficult. In this article I will describe how to achieve this with the magic of Spring Data JPA repositories (without SQL).&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-entity&#34;&gt;The Entity&lt;/h2&gt;&#xA;&lt;p&gt;First, we need a class describing the entities which should be retrieved from the database. We annotate the class with &lt;code&gt;@Entity&lt;/code&gt; to mark it as a representative of a database table. The class describes how the table in the database should look like. Each object of this class would be stored as one row in this table (in a relational database).&lt;/p&gt;</description>
			</item>
			<item>
				<title>autobahn-spring: Autobahn|Java and Spring</title>
				<link>https://felix-seifert.com/blog/integrate-autobahnjava-and-spring/</link>
				<pubDate>Sun, 27 Jan 2019 16:24:36 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/integrate-autobahnjava-and-spring/</guid>
				<description>&lt;p&gt;Are you an enthusiastic user of Spring and do you also want to benefit from the &lt;a href=&#34;https://felix-seifert.com/blog/web-application-messaging-protocol/&#34;&gt;Web Application Messaging Protocol&lt;/a&gt;? Even though &lt;a href=&#34;https://felix-seifert.com/blog/wamp2spring-router-topics-procedures/&#34;&gt;wamp2spring&lt;/a&gt; mainly serves as a router, Spring users often want to create several microservices communicating with each other. A comfortable solution is using the WAMP library &lt;a href=&#34;https://felix-seifert.com/blog/autobahnjava-wamp-library-crossbar/&#34;&gt;Autobahn|Java&lt;/a&gt;. This article will describe how to combine Spring and Autobahn|Java.&lt;/p&gt;&#xA;&lt;h2 id=&#34;create-a-controller-for-wamp&#34;&gt;Create a Controller for WAMP&lt;/h2&gt;&#xA;&lt;p&gt;Autobahn|Java could be implemented as a controller. Therefore, the bean of Spring should be created with the annotation &lt;code&gt;@Controller&lt;/code&gt;. &lt;a href=&#34;https://felix-seifert.com/blog/web-application-messaging-protocol/&#34;&gt;Topics and procedures&lt;/a&gt; could be handled exactly as described in the article about &lt;a href=&#34;https://felix-seifert.com/blog/autobahnjava-wamp-library-crossbar/&#34;&gt;Autobahn|Java&lt;/a&gt;. The methods implementing this should be registered as listeners. This could be achieved in the constructor of the controller.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JUnit 5: Lists in Parameterized Tests</title>
				<link>https://felix-seifert.com/blog/junit-5-parameterized-tests-using-lists-as-argument/</link>
				<pubDate>Sat, 29 Dec 2018 11:37:09 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/junit-5-parameterized-tests-using-lists-as-argument/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://junit.org/junit5/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;JUnit 5&lt;/a&gt; is one of the most common Java frameworks for unit tests. Version 5 offers parameterized test and is the new major release that replaces the older version 4 which was already released 2006.&#xA;Parameterized tests could be enabled with the annotation &lt;code&gt;@ParameterizedTest&lt;/code&gt;. They could be provided with data and could also be run several times with different values. In addition to providing parameterized tests with primitive data via the annotation &lt;code&gt;@ValueSource&lt;/code&gt;, it is also possible to pass more complex data via the annotation &lt;code&gt;@MethodSource&lt;/code&gt;. This article will show how to provide several lists for a parameterized test in JUnit 5.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Dynamic Programming: Saving Results</title>
				<link>https://felix-seifert.com/blog/dynamic-programming-increase-efficiency/</link>
				<pubDate>Sun, 25 Nov 2018 16:40:28 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/dynamic-programming-increase-efficiency/</guid>
				<description>&lt;p&gt;Dynamic programming is the process of splitting a complex problem into simpler sub-problems, storing the values of each sub-problem and saving time by using these values to calculate the complex problem.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dynamic-programming-explained-simple&#34;&gt;Dynamic Programming Explained Simple&lt;/h2&gt;&#xA;&lt;p&gt;Programming dynamically consists mainly out of saving results of simple tasks so that you do not have to calculate them again.&#xA;Assume a young kid who just learned addition in school. He/she writes down the task of calculating 1 + 1 + 1 + 1 + 1 + 1. After a short calculation, you know the solution is 6. Now, the kid adds a + 1 and asks you to calculate it. Of course, you could do the whole task of adding all the numbers again. But the idea of dynamic programming is using the previous result and adding the +1. Like this, you could get the solution quickly.&lt;/p&gt;</description>
			</item>
			<item>
				<title>wamp2spring: Topics and Procedures</title>
				<link>https://felix-seifert.com/blog/wamp2spring-router-topics-procedures/</link>
				<pubDate>Fri, 02 Nov 2018 17:36:02 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/wamp2spring-router-topics-procedures/</guid>
				<description>&lt;figure&gt;&#xA;  &lt;img src=&#34;https://felix-seifert.com/images/posts/wamp2spring2publicationsprocedures-1_hu_9ed4f8e5b618946e.webp&#34;&#xA;       &#xA;       srcset=&#34;https://felix-seifert.com/images/posts/wamp2spring2publicationsprocedures-1_hu_4cc26896e091d48a.webp 640w, https://felix-seifert.com/images/posts/wamp2spring2publicationsprocedures-1_hu_9ed4f8e5b618946e.webp 1280w&#34;&#xA;       sizes=&#34;(min-width: 42rem) 40rem, 100vw&#34;&#xA;       width=&#34;1280&#34; height=&#34;550&#34;&#xA;       alt=&#34;wamp2spring serves as a WAMP router and could register remote procedures and publish on topics.&#34;&#xA;       loading=&#34;lazy&#34; decoding=&#34;async&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;wamp2spring offers the option to serve as Web Application Messaging Protocol (WAMP) router publishing on topics and registering remote procedures. The article &lt;a href=&#34;https://felix-seifert.com/blog/wamp2spring-wamp-router/&#34;&gt;wamp2spring - Router for WAMP&lt;/a&gt; has already described how to set up a router with wamp2spring. In this article, we would learn how the router could publish on topics and register remote procedures.&#xA;Understanding RPC and Pub/Sub might be quite helpful for creating microservices communicating via WAMP. The different ways of communicating via the protocol are described in the article &lt;a href=&#34;https://felix-seifert.com/blog/web-application-messaging-protocol/&#34;&gt;Web Application Messaging Protocol&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>wamp2spring - Router for WAMP</title>
				<link>https://felix-seifert.com/blog/wamp2spring-wamp-router/</link>
				<pubDate>Sun, 21 Oct 2018 14:57:56 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/wamp2spring-wamp-router/</guid>
				<description>&lt;figure&gt;&#xA;  &lt;img src=&#34;https://felix-seifert.com/images/posts/wamp2spring2_hu_166425c4cd6e44f4.webp&#34;&#xA;       &#xA;       srcset=&#34;https://felix-seifert.com/images/posts/wamp2spring2_hu_b90b0b0c8c686307.webp 640w, https://felix-seifert.com/images/posts/wamp2spring2_hu_166425c4cd6e44f4.webp 1280w&#34;&#xA;       sizes=&#34;(min-width: 42rem) 40rem, 100vw&#34;&#xA;       width=&#34;1280&#34; height=&#34;427&#34;&#xA;       alt=&#34;wamp2spring is a library used for setting up a WAMP router.&#34;&#xA;       loading=&#34;lazy&#34; decoding=&#34;async&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;As I am a strong advocate of Spring Boot, I would present you with another way to set up a router for the Web Application Messaging Protocol (WAMP). This is based on the Java library &lt;a href=&#34;https://github.com/ralscha/wamp2spring&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;wamp2spring&lt;/a&gt; and Spring Boot (you could also use the Spring framework).&#xA;Besides setting up one or multiple WAMP clients (for example with &lt;a href=&#34;https://felix-seifert.com/blog/autobahnjava-wamp-library-crossbar/&#34;&gt;Autobahn|Java&lt;/a&gt;), a router is needed so that the clients could communicate with each other via WAMP. I have already described the idea in the article &lt;a href=&#34;https://felix-seifert.com/blog/web-application-messaging-protocol/&#34;&gt;Web Application Messaging Protocol&lt;/a&gt;.&#xA;Even though there are multiple options for settings, it is quite convenient to set up a router with the default settings.&#xA;A wamp2spring router itself could register remote procedures, as well as publish on topics, which could be addressed by the wamp clients. This article would present a solution of a router that does not register or publish.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Autobahn|Java - WAMP Library of Crossbar.io</title>
				<link>https://felix-seifert.com/blog/autobahnjava-wamp-library-crossbar/</link>
				<pubDate>Sat, 13 Oct 2018 19:35:04 +0000</pubDate>
				<guid>https://felix-seifert.com/blog/autobahnjava-wamp-library-crossbar/</guid>
				<description>&lt;figure&gt;&#xA;  &lt;img src=&#34;https://felix-seifert.com/images/posts/autobahn-java_hu_ed506ddbfb5517c2.webp&#34;&#xA;       &#xA;       srcset=&#34;https://felix-seifert.com/images/posts/autobahn-java_hu_5210dabd870c812d.webp 640w, https://felix-seifert.com/images/posts/autobahn-java_hu_ed506ddbfb5517c2.webp 1000w&#34;&#xA;       sizes=&#34;(min-width: 42rem) 40rem, 100vw&#34;&#xA;       width=&#34;1000&#34; height=&#34;333&#34;&#xA;       alt=&#34;This article describes how to implement a WAMP client using the library Autobahn|Java.&#34;&#xA;       loading=&#34;lazy&#34; decoding=&#34;async&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;You have already learned &lt;a href=&#34;https://felix-seifert.com/blog/local-crossbar-router-wamp/&#34;&gt;how to set up a local Web Application Messaging Protocol (WAMP) router&lt;/a&gt;. This article would describe how to make the first step in programming a microservice in Java using the library Autobahn|Java and, thus, how to use a WAMP router.&lt;/p&gt;&#xA;&lt;h2 id=&#34;idea-of-autobahnjava&#34;&gt;Idea of Autobahn|Java&lt;/h2&gt;&#xA;&lt;p&gt;A WAMP network usually consists of a router and multiple clients. The clients are often microservices which are part of, at least, one bigger service. While being connected with the router, these microservices can communicate with each other. The &lt;a href=&#34;https://felix-seifert.com/blog/web-application-messaging-protocol/&#34;&gt;article about WAMP&lt;/a&gt; describes the different ways of communicating via this protocol.&#xA;It is not relevant in which programming language the clients are being implemented, &lt;a href=&#34;https://github.com/crossbario/autobahn-java&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Autobahn|Java&lt;/a&gt; is the library of Crossbar.io to implement a client for a WAMP network specifically in Java. It is based on the framework &lt;a href=&#34;https://netty.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Netty&lt;/a&gt;, which is used for asynchronous programming.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
