<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MEHMET ARİF EMRE ŞEN on Medium]]></title>
        <description><![CDATA[Stories by MEHMET ARİF EMRE ŞEN on Medium]]></description>
        <link>https://medium.com/@maemresen?source=rss-d2b939c1b561------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZC0GuFNHfBnyqmrBy63eGg.jpeg</url>
            <title>Stories by MEHMET ARİF EMRE ŞEN on Medium</title>
            <link>https://medium.com/@maemresen?source=rss-d2b939c1b561------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:42:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maemresen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Efficient Testing with JUnit5: Parameterized Tests]]></title>
            <link>https://medium.com/yazilim-vip/efficient-testing-with-junit5-parameterized-tests-c2de6b76edc5?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2de6b76edc5</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[junit-5]]></category>
            <category><![CDATA[java-testing]]></category>
            <category><![CDATA[parameterized-tests]]></category>
            <category><![CDATA[programming-tips]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 01:09:38 GMT</pubDate>
            <atom:updated>2024-01-21T01:09:38.146Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to the guide on JUnit Parameterized tests. Here, I’ll show you how to use JUnit to test different data easily. We’ll go through step-by-step examples. Let’s learn how to make testing simpler and more effective!</p><h3>Source Code</h3><p><a href="https://github.com/maeworkshop/junit-workshop/tree/main/junit-unit-testing-examples/junit-ut-parameterized-tests">junit-workshop/junit-unit-testing-examples/junit-ut-parameterized-tests at main · maeworkshop/junit-workshop</a></p><h3>Prerequisites</h3><ul><li><strong>Java:</strong> Oracle JDK 21</li><li><strong>JUnit:</strong> 5.8.1</li><li><strong>IntelliJ IDEA</strong></li></ul><h3>Initial Configuration</h3><p>See my article to initialize your project.</p><p><a href="https://medium.com/yazilim-vip/junit-basics-with-maven-f6a6cbe87cb6">JUnit Basics with Maven</a></p><h3>Add Parameterized Test Dependency</h3><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br>    &lt;artifactId&gt;junit-jupiter-params&lt;/artifactId&gt;<br>    &lt;version&gt;${junit.version}&lt;/version&gt;<br>    &lt;scope&gt;test&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><h3>Getting Started with Parameterized Tests</h3><p>The @ParameterizedTest annotation is key in JUnit for defining a parameterized test. Unlike a standard test case, it indicates that the method will run multiple times with various inputs.</p><h3>Simple Examples</h3><h4>Testing with Null Values (NullSource)</h4><p>The @NullSource annotation is used to provide a null value to the test. The nullSourceTest method checks if the input string is null.</p><pre>@ParameterizedTest<br>@NullSource<br>void nullSourceTest(String str) {<br>    assertNull(str);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*E82oe80bq03hRmpGRWljeQ.png" /></figure><h4>Testing with Empty Source</h4><p>The @EmptySource annotation is used for testing with empty strings, lists, sets, and maps.</p><pre>@ParameterizedTest<br>@EmptySource<br>void emptyStringTest(String str) {<br>    assertTrue(str.trim().isEmpty());<br>}<br><br>@ParameterizedTest<br>@EmptySource<br>void emptyListTest(List&lt;?&gt; list) {<br>    assertTrue(list.isEmpty());<br>}<br><br>@ParameterizedTest<br>@EmptySource<br>void emptySetTest(Set&lt;?&gt; set) {<br>    assertTrue(set.isEmpty());<br>}<br><br>@ParameterizedTest<br>@EmptySource<br>void emptyMapTest(Map&lt;?, ?&gt; map) {<br>  assertTrue(map.isEmpty());<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*Z9ek5jCp0YJ7IFJK1ldKAw.png" /></figure><h4>Testing with Null and Empty Strings</h4><p>@NullAndEmptySource combines @NullSource and @EmptySource. The nullAndEmptySourceTest method tests if the string is either null or empty</p><pre>@ParameterizedTest<br>@NullAndEmptySource<br>void nullAndEmptySourceTest(String str) {<br>    assertTrue(str == null || str.trim().isEmpty());<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*jIffaOXwx62ZlXBWYndu3Q.png" /></figure><h3>Using Different Arguments in Tests</h3><blockquote>useful for tests requiring custom or programmatically generated data sets.</blockquote><h4><strong>Implementing Custom Arguments Providers</strong></h4><p>By implementing the ArgumentsProvider interface, this class offers a tailored method to deliver test arguments. This custom provider is utilized in the argumentSourceTest method through @ArgumentsSource annotation.</p><pre>static class NonBlankRandomStringArgumentProvider implements ArgumentsProvider {<br>    @Override<br>    public Stream&lt;? extends Arguments&gt; provideArguments(ExtensionContext context) {<br>        return Stream.of(<br>                Arguments.of(&quot;argumentProvider-a&quot;),<br>                Arguments.of(&quot;argumentProvider-b&quot;),<br>                Arguments.of(&quot;argumentProvider-c&quot;)<br>        );<br>    }<br>}<br><br>@ParameterizedTest<br>@ArgumentsSource(NonBlankRandomStringArgumentProvider.class)<br>void argumentSourceTest(String str) {<br>    assertFalse(isBlank(str));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*ir68S1KBvCRz_GP3ngD_9A.png" /></figure><h4>Custom Annotation for Argument Source</h4><p>To further streamline the process, a custom annotation @NonBlankRandomStringSource is created. This annotation encapsulates the @ArgumentsSource with NonBlankRandomStringArgumentProvider.</p><pre>@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})<br>@Retention(RetentionPolicy.RUNTIME)<br>@ArgumentsSource(NonBlankRandomStringArgumentProvider.class)<br>@interface NonBlankRandomStringSource {<br>}<br><br>@ParameterizedTest<br>@NonBlankRandomStringSource<br>void customAnnotationSourceTest(String str) {<br>    assertFalse(isBlank(str));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*1WCkQq2Jm0OXzsYh3AUJag.png" /></figure><h4>Using MethodSource</h4><p>In the MethodSourceTest class, we demonstrate how the @MethodSource annotation in JUnit facilitates dynamic and complex parameterized tests. We can effectively tailor test parameters by defining a method nonBlankStringsProvider that returns a stream of specific arguments, such as non-blank strings.</p><pre>class MethodSourceTest {<br><br>    private static Stream&lt;Arguments&gt; nonBlankStringsProvider() {<br>        return Stream.of(<br>                Arguments.of(&quot;method-a&quot;),<br>                Arguments.of(&quot;method-b&quot;),<br>                Arguments.of(&quot;method-c&quot;)<br>        );<br>    }<br><br>    @ParameterizedTest<br>    @MethodSource(&quot;nonBlankStringsProvider&quot;)<br>    void methodSourceTest(String str) {<br>        assertFalse(str == null || str.trim().isEmpty());<br>    }<br>}</pre><p>When you run your tests, you’ll notice output indicating that your test method has been executed three times, each time with different arguments provided by the nonBlankStringsProvider method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*XK5_TV4krXe_lzofsS9qiQ.png" /></figure><h3>Testing with CSV Files</h3><p>This section delves into utilizing the @CsvSource annotation in JUnit, showcasing how to conduct parameterized tests with CSV data efficiently. The CsvSourceTest class demonstrates two key approaches: direct CSV data use and custom conversion of CSV data.</p><h4>Direct CSV Data Usage</h4><p>The csvSourceTest the method illustrates a straightforward application of @CsvSource. CSV strings representing dates and their corresponding expected year values are parsed and tested. This @JavaTimeConversionPattern is used to convert the date strings into a date object.</p><pre>@ParameterizedTest(name = &quot;getYear({0}) should return {1}&quot;)<br>@CsvSource(value = {&quot;2012/12/25:2012&quot;, &quot;2013/12/25:2013&quot;, &quot;2014/12/25:2014&quot;}, delimiter = &#39;:&#39;)<br>void csvSourceTest(@JavaTimeConversionPattern(&quot;yyyy/MM/dd&quot;) LocalDate date, int expected) {<br>    assertEquals(expected, date.getYear());<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*G2ZxQa7oUeDqDo6VrwnmRA.png" /></figure><h4>Custom Converter for CSV Data</h4><p>For more complex scenarios, a custom converter LocalDateConverter can be used. This converter transforms CSV string data into LocalDate objects using a specific format. The csvSourceTestWithCustomConverter method demonstrates this approach, highlighting the flexibility of @CsvSource handling diverse data types and formats.</p><pre>static class LocalDateConverter implements ArgumentConverter {<br>    @Override<br>    public Object convert(Object source, ParameterContext context) throws ArgumentConversionException {<br>        if (source instanceof String dateString) {<br>            return LocalDate.parse(dateString, DateTimeFormatter.ofPattern(&quot;yyyy/MM/dd&quot;));<br>        }<br>        throw new ArgumentConversionException(source + &quot; is not a string&quot;);<br>    }<br>}<br><br>@ParameterizedTest(name = &quot;getYear({0}) should return {1}&quot;)<br>@CsvSource(value = {&quot;2012/12/25:2012&quot;, &quot;2013/12/25:2013&quot;, &quot;2014/12/25:2014&quot;}, delimiter = &#39;:&#39;)<br>void csvSourceTestWithCustomConverter(@ConvertWith(LocalDateConverter.class) LocalDate date, int expected) {<br>    assertEquals(expected, date.getYear());<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*qZTh9ABTdtDj7JtXQfeV3Q.png" /></figure><h3>Testing with Enum Values</h3><p>The EnumSourceTest the class provides a comprehensive demonstration of using the @EnumSource annotation in JUnit for parameterized tests based on enum values.</p><p>The enumSourceTest method exemplifies the basic usage of @EnumSource. It automatically provides all constants from the Month enum as parameters. The test ensures that each month&#39;s numerical value is between 1 and 12.</p><pre>@ParameterizedTest(name = &quot;{0}.getValue() must be between 1 and 12&quot;)<br>@EnumSource(Month.class)<br>void enumSourceTest(Month month) {<br>    final var monthNumber = month.getValue();<br>    assertAll(<br>            () -&gt; assertTrue(monthNumber &gt;= 1),<br>            () -&gt; assertTrue(monthNumber &lt;= 12));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*BUtoVit9N6UVWKPm4zBlvg.png" /></figure><h4>Including Certain Enum Constants</h4><p>In enumSourceOnlyIncludedTest, the @EnumSource is configured to include only specific months. This test checks that the included months (April, June, September, and November) all have 30 days.</p><pre>@ParameterizedTest(name = &quot;{0} must have 30 days&quot;)<br>@EnumSource(value = Month.class, names = {&quot;APRIL&quot;, &quot;JUNE&quot;, &quot;SEPTEMBER&quot;, &quot;NOVEMBER&quot;})<br>void enumSourceOnlyIncludedTest(Month month) {<br>    assertEquals(30, month.length(false));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*EC-iRXjYgTff-UCh977j2Q.png" /></figure><h4>Excluding Certain Enum Constants</h4><p>Conversely, enumSourceWithoutExcludedTest uses the @EnumSource to exclude specific months. It verifies that the remaining months, excluding April, June, September, November, and February, have 31 days.</p><pre>@ParameterizedTest(name = &quot;{0} must have 31 days&quot;)<br>@EnumSource(<br>        value = Month.class,<br>        names = {&quot;APRIL&quot;, &quot;JUNE&quot;, &quot;SEPTEMBER&quot;, &quot;NOVEMBER&quot;, &quot;FEBRUARY&quot;},<br>        mode = EnumSource.Mode.EXCLUDE<br>)<br>void enumSourceWithoutExcludedTest(Month month) {<br>    assertEquals(31, month.length(false));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*o7ilTe7WQuUQ6rdNJOcwow.png" /></figure><h4>Matching Enum Constants with Regular Expressions</h4><p>Finally, enumSourceOnlyMatchingNameTest demonstrates the use of regular expressions in @EnumSource. It selects months whose names end with &quot;BER&quot; and tests whether their names match this pattern.</p><pre>@ParameterizedTest(name = &quot;{0} must ends with BER&quot;)<br>@EnumSource(<br>        value = Month.class,<br>        names = &quot;.+BER&quot;,<br>        mode = EnumSource.Mode.MATCH_ANY<br>)<br>void enumSourceOnlyMatchingNameTest(Month month) {<br>    assertTrue(month.name().endsWith(&quot;BER&quot;));<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*onnyp2ipKNyRpO_bK1kNrA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2de6b76edc5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/efficient-testing-with-junit5-parameterized-tests-c2de6b76edc5">Efficient Testing with JUnit5: Parameterized Tests</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CDC with Debezium, Kafka, Spring Boot 3 and Postgres]]></title>
            <link>https://medium.com/yazilim-vip/cdc-with-debezium-kafka-spring-boot-3-and-postgres-a523d5237cca?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/a523d5237cca</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[cdc]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[spring-boot-3]]></category>
            <category><![CDATA[debezium]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 16:22:09 GMT</pubDate>
            <atom:updated>2024-01-14T16:23:32.696Z</atom:updated>
            <content:encoded><![CDATA[<p>This article, focusing on the technical details, explores a CDC implementation using Debezium, Apache Kafka, Spring Boot 3.1.2, and PostgreSQL. We’ll examine the architecture and configuration from the database to the Kafka consumer.</p><p>In this example, our application utilizes two tables: <strong><em>“person”</em></strong> and <strong><em>“audit”</em></strong>. Operations performed on the <strong><em>“person”</em></strong> table, such as data creation, trigger Debezium to publish corresponding events to Kafka. These events are then consumed and recorded in the <strong><em>“audit”</em></strong> table for tracking and analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ivFz0i1qbeDKAidu_VVhw.png" /></figure><h3>Source Code</h3><p><a href="https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-postgres-spring">debezium-workshop/debezium-postgres-spring at main · maeworkshop/debezium-workshop</a></p><h3>Overview of The Technologies</h3><ul><li><strong>Java Development Kit (JDK):</strong> 21</li><li><strong>Gradle 8.5</strong>,</li><li><strong>IntelliJ IDEA </strong>as an IDE</li><li><strong>Docker</strong></li><li><strong>Spring Boot:</strong> 3.1.2</li></ul><p><strong>Our CDC architecture includes:</strong></p><ul><li><strong>Debezium:</strong> Configured for capturing changes in PostgreSQL, linking directly to Kafka.</li><li><strong>Apache Kafka:</strong> Set up for efficient data streaming; we’ll cover key configuration details.</li><li><strong>Spring Boot:</strong> Used for building Kafka-interacting services</li><li><strong>PostgreSQL:</strong> Configured to work with Debezium for data capture.</li></ul><blockquote>Please see more in my previous article for the configuration details<br><strong>Article link: </strong><a href="https://medium.com/yazilim-vip/change-data-capture-magic-streaming-with-debezium-kafka-and-docker-fa31328ef14e">Streaming with Debezium, Kafka and Docker</a></blockquote><h3>Step1: Preparing Environment with Docker</h3><p>Kick-start your journey by launching the necessary services using Docker. We could use a docker-compose file to create containers.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/docker-compose.yaml">docker-compose.yaml</a></blockquote><p>Our docker-compose file consists of the following container</p><ul><li><strong>database:</strong> Hosts the PostgreSQL database</li><li><strong>zookeeper:</strong> Manages cluster coordination and state for Kafka.</li><li><strong>Kafka:</strong> Runs the Apache Kafka service for data streaming</li><li><strong>connect:</strong> Executes the Debezium service, CDC from PostgreSQL.</li><li><strong>kafka-ui:</strong> GUI to monitor Kafka clusters.</li><li><strong>debezium-ui:</strong> GUI for configuring and monitoring Debezium connectors.</li><li><strong>setup-debezium-connector:</strong> A temporary container used to create the initial Debezium PostgreSQL connector.</li></ul><p>Now, just run the following command to start containers.</p><pre>docker-compose up -d</pre><p>Please wait a minute and verify if all containers are operational and healthy. After this interval, you should observe that all containers are up and running, except for <strong><em>“setup-debezium-connector”</em></strong> container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jry2utRWBi4Km_RD4CoEPw.png" /></figure><p>Initially, the topics you should have on Kafka can be found on the Kafka UI screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6clnnxxY9b7b1o4ZUTgAJQ.png" /><figcaption><strong>Kafka UI:</strong> <a href="http://localhost:9000/">http://localhost:900</a>0</figcaption></figure><p>Debezium — PostgreSQL connector configurations exist inside “<strong><em>docker-compose”</em></strong> file.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/docker-compose.yaml">docker-compose.yaml</a></blockquote><pre>{<br>  &quot;name&quot;: &quot;postgresql-connector&quot;,<br>  &quot;config&quot;: {<br>    &quot;connector.class&quot;: &quot;io.debezium.connector.postgresql.PostgresConnector&quot;,<br>    &quot;connector.displayName&quot;: &quot;PostgreSQL&quot;,<br>    &quot;topic.prefix&quot;: &quot;pg-changes&quot;,<br>    &quot;database.user&quot;: &quot;postgres&quot;,<br>    &quot;database.dbname&quot;: &quot;db_local&quot;,<br>    &quot;table.exclude.list&quot;: &quot;audit&quot;,<br>    &quot;database.hostname&quot;: &quot;database&quot;,<br>    &quot;database.password&quot;: &quot;postgres&quot;,<br>    &quot;name&quot;: &quot;postgresql-connector&quot;,<br>    &quot;connector.id&quot;: &quot;postgres&quot;,<br>    &quot;plugin.name&quot;: &quot;pgoutput&quot;<br>  } <br>}</pre><p>On Debezium UI, you should see <em>“</em><strong><em>postgresql-connector</em></strong><em>”</em> with the status <em>“</em><strong><em>RUNNING</em></strong><em>”</em> as in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hbNuq09prkEbohPag1R4Q.png" /><figcaption><strong>Debezium UI:</strong> <a href="http://localhost:9091/">http://localhost:9091</a></figcaption></figure><h3>Step 2: Configuring Spring Boot Project</h3><h4>Step2.1: Create an empty project</h4><p>If you are not familiar with Gradle, you could use the following links;</p><blockquote><a href="https://docs.gradle.org/current/userguide/userguide.html">What is Gradle?</a><br><a href="https://docs.gradle.org/current/samples/sample_building_java_applications.html">Building Java Applications Sample</a></blockquote><h4>Step 2.1: Configuring build.gradle.kts</h4><p>Let’s start with configuring our Gradle build script. We will use Kotlin DSL for the Gradle build scripts. The full version exists on my GitHub repo.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/build.gradle.kts">build.gradle.kts</a></blockquote><ol><li>We use the Spring Boot plugin for configuration and the Dependency Management plugin for version consistency.</li></ol><pre>id(&quot;org.springframework.boot&quot;) version &quot;3.2.1&quot;<br>id(&quot;io.spring.dependency-management&quot;) version &quot;1.1.4&quot;</pre><p>2. Configure dependencyManagement to import Spring Cloud BOM, ensuring version compatibility of all Spring Cloud components.</p><pre>dependencyManagement {<br>    imports {<br>        mavenBom(&quot;org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}&quot;)<br>    }<br>}</pre><p>3. Add necessary dependencies</p><pre>// For creating web applications with RESTful support<br>implementation(&quot;org.springframework.boot:spring-boot-starter-web&quot;)<br><br>// Handles JSON operations in the application<br>implementation(&quot;org.springframework.boot:spring-boot-starter-json&quot;)<br><br>// Integrates Spring Data JPA and PostgreSQL driver for database interactions<br>implementation(&quot;org.springframework.boot:spring-boot-starter-data-jpa&quot;)<br>implementation(&quot;org.postgresql:postgresql&quot;)<br><br>// For integrating and testing with Apache Kafka using Spring Cloud Stream<br>implementation(&quot;org.springframework.cloud:spring-cloud-starter-stream-kafka&quot;)<br>testImplementation(&quot;org.springframework.cloud:spring-cloud-stream-test-binder&quot;)<br><br>// Other (Optional): Lombok for reducing boilerplate code<br>compileOnly(&quot;org.projectlombok:lombok:$lombokVersion&quot;)<br>annotationProcessor(&quot;org.projectlombok:lombok:$lombokVersion&quot;)<br>testCompileOnly(&quot;org.projectlombok:lombok:$lombokVersion&quot;)<br>testAnnotationProcessor(&quot;org.projectlombok:lombok:$lombokVersion&quot;)</pre><h4>Step 2.2: Configuring Spring Boot application</h4><ol><li>The next step is configuring our “<strong><em>application.yaml</em></strong>” file. Here, we will configure kafka to consume Debezium Events. The full versions of the files exist on my GitHub repo.</li></ol><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/resources/application.yaml">application.yaml</a></blockquote><pre>spring:<br>  ...<br>  cloud:<br>    stream:<br>      kafka:<br>        binder:<br>          brokers: localhost:9093<br>      bindings:<br>        debeziumEventConsumer-in-0:<br>          destination: pg-changes.public.person<br>          group: 1<br>          content-type: application/json</pre><blockquote><strong>NOTE THAT: </strong>In our Debezium configuration, we have set “<strong>pg-changes</strong>” as the Kafka topic prefix. This is indicated by the “<strong>topic.prefix</strong>” property in the connector configuration JSON mentioned above. The prefix “<strong>public</strong>” refers to our schema on the database, and “<strong>person</strong>” is the table&#39;s name.</blockquote><p>2. Let’s create the required Entity and Repository classes.</p><blockquote><strong>See: </strong><a href="https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/entity">entities package</a><br><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/repository">repositories package</a></blockquote><pre>@Entity<br>public class Person {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.AUTO)<br>    private Long id;<br>    private String firstName;<br>    private String lastName;<br>}<br><br>@Entity<br>public class Audit {<br>    @Id<br>    @GeneratedValue(strategy = GenerationType.AUTO)<br>    private Long id;<br>    private String tableName;<br>    private String operation;<br>    private LocalDateTime time;<br>    private String owner;<br>    private String value;<br>}<br><br>@Repository<br>public interface PersonRepository extends JpaRepository&lt;Person, Long&gt; {<br>}<br><br>@Repository<br>public interface AuditRepository extends JpaRepository&lt;Audit, Long&gt; {<br>}</pre><p>3. Now, create the DTO to capture Debezium events.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/dto/DebeziumEventDto.java">DebeiumEventDto.java</a></blockquote><pre>@Data<br>public class DebeziumEventDto {<br>    <br>    private Payload payload;<br><br>    @Data<br>    public static class Payload {<br>        private Source source;<br>        private Map&lt;String, Object&gt; before;<br>        private Map&lt;String, Object&gt; after;<br><br>        @JsonProperty(&quot;op&quot;)<br>        @JsonDeserialize(using = OperationTypeDeserializer.class)<br>        @JsonFormat<br>        private OperationType operationType;<br><br>        @Data<br>        public static class Source {<br>            @JsonProperty(&quot;ts_ms&quot;)<br>            @JsonDeserialize(using = MillisToLocalDateTimeDeserializer.class)<br>            private LocalDateTime transactionTime;<br><br>            private String db;<br>            private String schema;<br>            private String table;<br><br>            @JsonProperty(&quot;txId&quot;)<br>            private long transactionId;<br>        }<br>    }<br><br>    @Getter<br>    public enum OperationType {<br>        CREATE(&quot;c&quot;),<br>        UPDATE(&quot;u&quot;),<br>        DELETE(&quot;d&quot;),<br>        READ(&quot;r&quot;);<br><br>        private final String code;<br><br>        OperationType(String code) {<br>            this.code = code;<br>        }<br><br>        public static OperationType fromCode(String code) {<br>            for (OperationType type : OperationType.values()) {<br>                if (type.getCode().equals(code)) {<br>                    return type;<br>                }<br>            }<br>            throw new IllegalArgumentException(&quot;Unknown operation type code: &quot; + code);<br>        }<br>    }<br>}</pre><p>4. Creating a Kafka Consumer.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/messasing/DebeziumEventConsumer.java">DebeziumEventConsumer.java</a></blockquote><pre>@Slf4j<br>@RequiredArgsConstructor<br>@Component<br>public class DebeziumEventConsumer implements Consumer&lt;DebeziumEventDto&gt; {<br><br>    private final AuditRepository auditRepository;<br><br>    @Override<br>    public void accept(DebeziumEventDto eventDto) {<br>        try {<br>            final var payload = eventDto.getPayload();<br>            final var source = payload.getSource();<br>            final var audit = Audit.builder()<br>                    .tableName(source.getTable())<br>                    .operation(payload.getOperationType().name())<br>                    .time(source.getTransactionTime())<br>                    .value(Optional.ofNullable(payload.getAfter()).map(Object::toString).orElse(null))<br>                    .build();<br>            final Audit savedAudit = auditRepository.save(audit);<br>            log.info(&quot;{} event on {} table is audited as {}&quot;,<br>                    payload.getOperationType(),<br>                    source.getTable(),<br>                    savedAudit);<br>        } catch (Exception e) {<br>            log.error(&quot;Failed to processing consumed message {}&quot;, eventDto, e);<br>        }<br>    }<br>}</pre><p>4. To use DebeziumEventDto, we need the following serializers.</p><blockquote><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/config/jackson/MillisToLocalDateTimeDeserializer.java">MillisToLocalDateTimeDeserializer.java</a><br><strong>See:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/config/jackson/OperationTypeDeserializer.java">OperationTypeDeserialize.java</a></blockquote><pre>public class MillisToLocalDateTimeDeserializer extends JsonDeserializer&lt;LocalDateTime&gt; {<br>    @Override<br>    public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {<br>        final long timestamp = p.getLongValue();<br>        return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneOffset.UTC);<br>    }<br>}<br><br>public class OperationTypeDeserializer extends JsonDeserializer&lt;DebeziumEventDto.OperationType&gt; {<br>    @Override<br>    public DebeziumEventDto.OperationType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {<br>        return DebeziumEventDto.OperationType.fromCode(jsonParser.getValueAsString());<br>    }<br>}</pre><h3>Step3: Testing Application</h3><p>Let’s create a controller class to create a random user. The final version can be found on my GitHub Repo</p><blockquote><strong>See: </strong><a href="https://github.com/maeworkshop/debezium-workshop/blob/main/debezium-postgres-spring/src/main/java/com/maemresen/debezium/postgres/spring/rest/PersonRestController.java">PersonRestController.java</a></blockquote><pre>@RequiredArgsConstructor<br>@RequestMapping(&quot;api/person&quot;)<br>@RestController<br>public class PersonRestController {<br><br>    private final PersonRepository personRepository;<br><br>    @GetMapping(&quot;/random&quot;)<br>    public ResponseEntity&lt;Person&gt; random() {<br>        final String randomFirstName = &quot;Maemre&quot; + Math.random();<br>        final String randomLastName = &quot;Sen&quot; + Math.random();<br>        return ResponseEntity.ok(personRepository.save(new Person(null, randomFirstName, randomLastName)));<br>    }<br>}</pre><p>Now, let’s start our Spring Boot application. After you start, you should see the <em>“</em><strong><em>pg-changes.public.person”</em></strong> topic on your Kafka</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKiOQC8yT0an0Jzv2T-ilA.png" /><figcaption><strong>Kafka UI:</strong> https://localhost:9000</figcaption></figure><p>Call <a href="https://localhost:8080/api/person/random"><strong>https://localhost:8080/api/person/random</strong></a> API.</p><p>If everything works fine, you should see the log on our Kafka Consumer and the Audit data on the <strong>“audit”</strong> table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dU9Gu8MbKncmzjtmFUpucQ.png" /><figcaption>Debezium Event Kafka Consumer Log</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXpHAaJiFWWdHWcgAuYiIA.png" /><figcaption>Audit Table Data</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a523d5237cca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/cdc-with-debezium-kafka-spring-boot-3-and-postgres-a523d5237cca">CDC with Debezium, Kafka, Spring Boot 3 and Postgres</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JUnit Basics with Maven]]></title>
            <link>https://medium.com/yazilim-vip/junit-basics-with-maven-f6a6cbe87cb6?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6a6cbe87cb6</guid>
            <category><![CDATA[unit-test-framework]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[junit]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sat, 25 Nov 2023 09:26:24 GMT</pubDate>
            <atom:updated>2023-11-25T09:30:31.755Z</atom:updated>
            <content:encoded><![CDATA[<p>Dive into the essentials of Java testing with this concise guide on JUnit and Maven! We’ll cover setting up a Maven project, configuring key settings in pom.xml, and crafting your first JUnit test in IntelliJ IDEA. Perfect for beginners, this article is a quick, practical introduction to the world of Java unit testing 🌟.</p><h3>Github</h3><p>Find all the code snippets from this article in my GitHub repo! 💻✨ Dive into the world of JUnit with these hands-on examples.</p><p>🚀 Happy coding! 🎉</p><p><a href="https://github.com/maeworkshop/junit-workshop">GitHub - maeworkshop/junit-workshop</a></p><h3>Pre-Requisites:</h3><p>Make sure you’re up to speed with Maven and have IntelliJ IDEA (Ultimate or Community Edition) installed. Need help? Check these links:</p><blockquote><a href="https://maven.apache.org/">Introduction to Maven</a><br><a href="https://www.jetbrains.com/idea/download/?section=mac">IntelliJ IDEA</a></blockquote><h3>What is JUnit?</h3><blockquote>JUnit is the go-to framework for testing in Java, ensuring your code is robust and reliable.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bJIk0AnewoPa-nGN.jpg" /></figure><blockquote><a href="https://junit.org/junit5/docs/current/user-guide/#overview">JUnit5 User Guide</a></blockquote><h3>Setting Up a Maven Project for JUnit Testing</h3><h4>Step 1: Creating an Empty Maven Project</h4><ol><li>Open a terminal or command prompt.</li><li>Execute the Maven command:</li></ol><pre>mvn archetype:generate\<br>        -DgroupId=com.maemresen\<br>        -DartifactId=junit-hello-world\<br>        -DarchetypeArtifactId=maven-archetype-quickstart\<br>        -DinteractiveMode=false</pre><p>This command sets up a basic Maven project structure. Learn more about Maven archetypes <a href="https://maven.apache.org/guides/introduction/introduction-to-archetypes.html">here</a>.</p><p>3. Open the project in your IntelliJ IDEA.</p><p>4. Update pom.xml with essential configurations:</p><blockquote>Complete pom.xml could be found on my example GitHub repo.<br><strong>Reference:</strong> <a href="https://github.com/maeworkshop/junit-workshop/blob/main/junit-unit-testing-examples/junit-ut-basics/pom.xml">pom.xml</a></blockquote><pre>&lt;properties&gt;<br>    &lt;!-- Java version setup --&gt;<br>    &lt;maven.compiler.source&gt;17&lt;/maven.compiler.source&gt;<br>    &lt;maven.compiler.target&gt;17&lt;/maven.compiler.target&gt;<br>    <br>    &lt;!-- JUnit version --&gt;<br>    &lt;junit.version&gt;5.8.1&lt;/junit.version&gt;<br>    <br>    &lt;!-- Maven Surefire Plugin version --&gt;<br>    &lt;maven-surefire-plugin.version&gt;3.1.2&lt;/maven-surefire-plugin.version&gt;<br>&lt;/properties&gt;<br><br>&lt;dependencies&gt;<br>    &lt;!-- JUnit Jupiter Engine for testing --&gt;<br>    &lt;dependency&gt;<br>        &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br>        &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;<br>        &lt;version&gt;${junit.version}&lt;/version&gt;<br>        &lt;scope&gt;test&lt;/scope&gt;<br>    &lt;/dependency&gt;<br>&lt;/dependencies&gt;<br><br>&lt;build&gt;<br>    &lt;plugins&gt;<br>        &lt;!-- Configuring Maven Surefire Plugin for testing --&gt;<br>        &lt;plugin&gt;<br>            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>            &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;<br>            &lt;version&gt;${maven-surefire-plugin.version}&lt;/version&gt;<br>        &lt;/plugin&gt;<br>    &lt;/plugins&gt;<br>&lt;/build&gt;</pre><blockquote>The Maven Surefire Plugin is essential for executing unit tests during your build process, making sure all tests pass before completion to maintain code quality and functionality. More detailed insights on this will be shared in a later article — a basic understanding is crucial for now 🌟.<br><strong>Reference: </strong><a href="https://maven.apache.org/surefire/maven-surefire-plugin/">Maven Surfire Plugin — Introduction</a></blockquote><h4>Step 2: Writing Your First Test in IntelliJ IDEA</h4><ol><li>Navigate to src/test/java/com/maemresen.</li><li>Create HelloWorldTest.java:</li></ol><pre>import org.junit.jupiter.api.Test;<br><br>import static org.junit.jupiter.api.Assertions.assertEquals;<br><br>class HelloWorldTest {<br>    // A test method that will pass because the assertion condition is true.<br>    @Test<br>    void successTest() {<br>        String str = &quot;Junit is working fine&quot;;<br>        assertEquals(&quot;Junit is working fine&quot;, str, &quot;Expected string to match the defined value&quot;);<br>    }<br>}</pre><blockquote>Remember, in JUnit 5, your test class doesn’t have to be public. They even recommend keeping them non-public!<br><strong>Reference:</strong> <a href="https://junit.org/junit5/docs/current/user-guide/#writing-tests-classes-and-methods">JUnit5 — Test Classes and Methods</a></blockquote><p>3.2. Run the test in IntelliJ IDEA by clicking the run icon next to the test method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fVEql-hK-KQEBhXW1JYAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ve9s1bbay2ihhUmxK7w2Nw.png" /></figure><p><strong>Coming Soon:</strong> We’ll explore ordered and nested tests and concepts like the Maven Surefire plugin for efficient test execution. Stay tuned for a comprehensive journey into Java testing! 🚀✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6a6cbe87cb6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/junit-basics-with-maven-f6a6cbe87cb6">JUnit Basics with Maven</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Change Data Capture Magic: Streaming with Debezium, Kafka, and Docker]]></title>
            <link>https://medium.com/yazilim-vip/change-data-capture-magic-streaming-with-debezium-kafka-and-docker-fa31328ef14e?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa31328ef14e</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[change-data-capture]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[debezium]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 03:21:01 GMT</pubDate>
            <atom:updated>2023-11-19T03:22:03.825Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*_1XjA2lJS5ygq-cw" /></figure><h3>Introduction</h3><p>In software engineering, seamless data synchronization across platforms is paramount, and Change Data Capture (CDC) stands out as a solution. While Debezium, Kafka, and Docker are powerful in their own right, orchestrating them together can be intricate. This guide delves into the specifics of configuration and integration, ensuring you can harness the full potential of CDC. Ready to step up your CDC game? Dive in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*8aS3hIbjLpjpXo4r1bf_3Q.png" /></figure><h3><strong>Step 1: Create a Container with Docker-Compose</strong></h3><p>Kick-start your journey by launching the necessary services using Docker. Your docker-compose.yml should establish PostgreSQL, Kafka, Zookeeper, and Debezium Connect services.</p><blockquote>The volume binding for the database container is solely used to pre-initialize the database with a table. Refer to the ‘init-scripts’ folder in my GithubRepo for additional details.<br><strong>See my GitHub repo:</strong> <a href="https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-and-kafka/init-scripts">init-scripts</a></blockquote><blockquote>The wal_level=logical configuration in PostgreSQL is pivotal for enabling logical decoding, a requisite for Change Data Capture (CDC) with Debezium. <br><strong>See official documentation: </strong><a href="https://debezium.io/documentation/reference/stable/connectors/postgresql.html#setting-up-postgresql">Debezium Setting Up PostgreSQL</a></blockquote><pre>version: &#39;3.8&#39;<br>services:<br>  database:<br>    image: postgres:14.1-alpine<br>    environment:<br>      - POSTGRES_USER=postgres<br>      - POSTGRES_PASSWORD=postgres<br>      - POSTGRES_DB=db_local<br>    ports:<br>      - 5432:5432<br>    volumes:<br>      - ./init-scripts:/docker-entrypoint-initdb.d<br>    command: [ &quot;postgres&quot;, &quot;-c&quot;, &quot;wal_level=logical&quot; ]<br>  zookeeper:<br>    image: zookeeper:3.9.0<br>  kafka:<br>    image: docker.io/bitnami/kafka:3.4<br>    depends_on:<br>      - zookeeper<br>    environment:<br>      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181<br>  debezium-connect:<br>    image: debezium/connect:2.4.0.Final<br>    links:<br>      - kafka<br>      - database<br>    environment:<br>      - BOOTSTRAP_SERVERS=kafka:9092<br>      - GROUP_ID=debezium-events<br>      - CONFIG_STORAGE_TOPIC=debezium_configs<br>      - OFFSET_STORAGE_TOPIC=debezium_offsets<br>      - STATUS_STORAGE_TOPIC=debezium_statuses<br>    ports:<br>      - 8083:8083</pre><h3>Step 2: Connector Management Using Debezium’s API</h3><p>In this phase, we’ll establish a solid bridge between our database and Kafka by precisely setting up and validating Debezium connectors.</p><h4>A. Establishing the Debezium Connector</h4><p>These connectors act as agents that sync your database changes to Kafka topics.</p><p><strong>Creating connectors using REST API</strong><br>To create the connector, invoke a POST request:</p><blockquote><strong>debezium-connector-config.json</strong></blockquote><pre>{<br>  &quot;name&quot;: &quot;postgresql-connector&quot;,<br>  &quot;config&quot;: {<br>    &quot;connector.class&quot;: &quot;io.debezium.connector.postgresql.PostgresConnector&quot;,<br>    &quot;connector.displayName&quot;: &quot;PostgreSQL&quot;,<br>    &quot;topic.prefix&quot;: &quot;pg-changes&quot;,<br>    &quot;database.user&quot;: &quot;postgres&quot;,<br>    &quot;database.dbname&quot;: &quot;db_local&quot;,<br>    &quot;table.exclude.list&quot;: &quot;audit&quot;,<br>    &quot;database.hostname&quot;: &quot;database&quot;,<br>    &quot;database.password&quot;: &quot;postgres&quot;,<br>    &quot;name&quot;: &quot;postgresql-connector&quot;,<br>    &quot;connector.id&quot;: &quot;postgres&quot;,<br>    &quot;plugin.name&quot;: &quot;pgoutput&quot;<br>  }<br>}</pre><blockquote><strong>Create Connector request via curl</strong></blockquote><pre>curl http://localhost:8083/connectors \<br>    -H &#39;Content-Type: application/json&#39; \<br>    -X POST \<br>    -d &#39;@debezium-connector-config.json&#39;</pre><p><strong>Critical Elements in the Configuration</strong><br>For this guide, we’ve outlined a reference configuration in debezium-connector-config.json Key attributes include:</p><ul><li><strong>Name</strong>: A unique identifier for the connector.</li><li><strong>Connector.class</strong>: The Debezium connector type.</li><li><strong>Database</strong>: Parameters like <strong>hostname</strong>, <strong>user</strong>, <strong>password</strong>, and <strong>dbname</strong> to authenticate and locate the database.</li><li><strong>Table</strong>: Directives like <strong>include.list</strong> or <strong>exclude.list</strong> to filter which tables to monitor.</li></ul><blockquote><strong>See official API Documentation:</strong> <a href="https://docs.confluent.io/platform/current/connect/references/restapi.html#post--connectors">Connector Create</a></blockquote><h4>B. Health Check for the Connector</h4><p>Post-deployment it’s a software engineering best practice to ensure our connectors are up and functioning as intended.</p><p><strong>Fetching Connector Status</strong><br>Invoke the following command to retrieve the status</p><pre># Command Template <br># curl -H &quot;Accept:application/json&quot; localhost:8083/connectors/[Your-Connector-Name]/status<br># Example<br>curl -H &quot;Accept:application/json&quot; localhost:8083/connectors/postgresql-connector/status</pre><p>A typical operational response will look like:</p><pre>{<br>    &quot;name&quot;: &quot;inventory-connector&quot;,<br>    &quot;connector&quot;: {<br>        &quot;state&quot;: &quot;RUNNING&quot;,<br>        &quot;worker_id&quot;: &quot;192.168.1.8:8083&quot;<br>    },<br>    &quot;tasks&quot;: [<br>        {<br>            &quot;id&quot;: 0,<br>            &quot;state&quot;: &quot;RUNNING&quot;,<br>            &quot;worker_id&quot;: &quot;192.168.1.8:8083&quot;<br>        }<br>    ],<br>    &quot;type&quot;: &quot;source&quot;<br>}</pre><p>The key is to look for &quot;state&quot;: &quot;RUNNING&quot; under both connector and tasks, indicating optimal performance.</p><blockquote><a href="https://docs.confluent.io/platform/current/connect/references/restapi.html#get--connectors-(string-name)-status"><strong>See official API Documentation:</strong></a> <a href="https://docs.confluent.io/platform/current/connect/references/restapi.html#get--connectors-(string-name)-status">Check Connector Status</a></blockquote><p>With these steps, we’ve ensured our data flow from the database to Kafka is healthy.</p><h3>Step 3: Verifying Topic Creation and Streaming in Kafka</h3><p>In this step, we aim to check if the topics are created in Kafka and whether the database changes are streamed into them.</p><blockquote>see <a href="https://kafka.apache.org/quickstart">Kafka Topic Management</a> if you are not familiar with Kafka scripts</blockquote><p><strong>Important Note</strong></p><blockquote>Ensure to make data manipulations (INSERT, UPDATE, DELETE) in your database after setting up Debezium and while checking Kafka topics. Without these activities, there will be no change events to capture and stream into Kafka</blockquote><h4>A. <strong>Verify Topic Creation:</strong></h4><p>Execute the following command to list all available topics in Kafka. Be sure to replace [Kafka Container ID] with the actual ID of your Kafka container.</p><pre>docker exec -it [Kafka Container ID] /opt/bitnami/kafka/bin/kafka-topics.sh \<br>    --list \<br>    --bootstrap-server localhost:9092</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*wuxXZuYCtmrNRuccnul9fA.png" /><figcaption>Example output</figcaption></figure><h4>B. <strong>Data Activity for Streaming Verification:</strong></h4><p>There should be database activities to observe the data change events in Kafka topics. Let’s insert, update, or delete some records in the database, thereby triggering Debezium to capture these changes and send them to Kafka topics.</p><p>Execute the following command to consume messages from a Kafka topic.</p><pre>docker exec -it [Kafka Container ID] /opt/bitnami/kafka/bin/kafka-console-consumer.sh \<br>    --topic [Your-Topic-Name] \<br>    --bootstrap-server localhost:9092 \<br>    --from-beginning</pre><p><em>Replace </em><em>[Your-Topic-Name] with the relevant topic name. Adding </em><em>--from-beginning will fetch all messages from the start of the log; omit to bring only subsequent messages.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QC7wERdYEp5iYE45dlMj2Q.png" /><figcaption>Example Consumed Message</figcaption></figure><p>A Typical message be like:</p><pre>{<br>  &quot;schema&quot;: {<br>    // ....<br>  },<br>  &quot;payload&quot;: {<br>    &quot;before&quot;: null,<br>    &quot;after&quot;: {<br>      &quot;id&quot;: 1,<br>      &quot;first_name&quot;: &quot;Emre&quot;,<br>      &quot;last_name&quot;: &quot;Sen&quot;<br>    },<br>    &quot;source&quot;: {<br>      &quot;name&quot;: &quot;pg-changes&quot;, // connector name<br>      &quot;ts_ms&quot;: 1697351918939, // timestamp of the transaction<br>      &quot;db&quot;: &quot;db_local&quot;,<br>      &quot;schema&quot;: &quot;public&quot;, <br>      &quot;table&quot;: &quot;person&quot;,<br>      &quot;txId&quot;: 739, // transaction id<br>      &quot;lsn&quot;: 24277320, // log sequence number<br>      // ...<br>    },<br>    &quot;op&quot;: &quot;c&quot;, // operation type<br>  }<br>}</pre><blockquote><a href="https://debezium.io/documentation/reference/stable/connectors/postgresql.html">Check Debezium PostgreSQL Connector</a></blockquote><h4>Points to Note:</h4><ul><li><strong>Understanding Message Output</strong>: Your console will stream messages, each representing a change in your database. They encode details like the operation type, source information, and the state of the changed record.</li></ul><h4>Troubleshooting</h4><ul><li><strong>No Topics Listed</strong>: Ensure your connector is running and verify database changes are triggering events.</li><li><strong>No Messages</strong>: Check for potential network issues or misconfigurations in Debezium connector settings.</li></ul><h3>GitHub Link</h3><p><a href="https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-and-kafka">https://github.com/maeworkshop/debezium-workshop/tree/main/debezium-and-kafka</a></p><h3>Upcoming next…</h3><p>So, you’ve ventured into the world of Change Data Capture with Debezium, Kafka, and Docker, and you’re feeling confident. But wait! Need some clarity on configuring Spring Boot for Kafka consumption? Or maybe a quick primer on managing Debezium connectors via a Spring Boot REST API? Don’t fret; the upcoming articles are designed to be your beacon. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa31328ef14e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/change-data-capture-magic-streaming-with-debezium-kafka-and-docker-fa31328ef14e">Change Data Capture Magic: Streaming with Debezium, Kafka, and Docker</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bu yazının amacı Maven ile siz okurları tanıştırmaktır.]]></title>
            <link>https://medium.com/yazilim-vip/bu-yaz%C4%B1n%C4%B1n-amac%C4%B1-maven-ile-siz-okurlar%C4%B1-tan%C4%B1%C5%9Ft%C4%B1rmakt%C4%B1r-aab0f6ff91f4?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab0f6ff91f4</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[build-management-tool]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Wed, 03 Jul 2019 23:07:15 GMT</pubDate>
            <atom:updated>2021-02-15T00:59:31.943Z</atom:updated>
            <content:encoded><![CDATA[<h3>Maven Nedir?</h3><p>Bu yazının amacı Maven ile siz okurları tanıştırmaktır. Bu sebeple, fazla detaya inmeden kısaca Maven nedir? Neden Maven kullanmalıyız? Bu konular hakkında kısa kısa bilgiler veriyor olacağım. Öyleyce öncelikle en temel soruyla başlayalım neden Maven?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/0*jxZrlz2BsqMlSMBQ" /></figure><h3>Neden Maven?</h3><p>Aslında aşağıdaki durumlar aslında neden Maven’a ihtiyaç duyuyoruz sorusunun cevabı, eğer,</p><ol><li>Yönetmeniz gereken çok fazla bağımlılığınız varsa</li><li>Bağımlılıklarınız çok sık güncelleniyorsa</li><li>CD / CI ve Testing işlemlerini uygulamayı düşünüyorsanız</li><li>Kod dokümantasyonunu, kaynak kodunu, ZIP olarak veya JAR olarak vb arşivlemeyi düşünüyorsanız</li></ol><p>Maven öğrenmeye başlayarak doğru bir adım attınız tebrik ederim. Öyleyse nedir bu Maven kısaca buna değinelim.</p><h3>Nedir bu Maven</h3><p>Maven, POM(Project Object Model)’a dayanan güçlü bir proje yönetim aracıdır. Proje oluşturma, bağımlılık ve dokümantasyon için kullanılır. ANT gibi derleme işlemini basitleştirir. Ancak ANT’den çok daha ileri bir teknolojidir.</p><p>Kısacası, Maven için herhangi bir Java tabanlı projeyi oluşturmak ve yönetmek için kullanılabilecek bir araçtır demek çokta yanlış olmayacaktır. Maven, Java geliştiricilerinin günlük işlerini kolaylaştırır ve genellikle herhangi bir Java tabanlı projenin anlaşılmasına yardımcı olur. Peki Maven’ın yardımcı olduğu temel noktalar nelerdi?</p><ul><li>Projeleri kolayca build edebiliriz</li><li>Hiç zorlanmadan JAR, WAR gibi istediğimiz paket formatında projeyi derleyebiliriz</li><li>Projenin bağımlılıklarını kolayca yönetebiliriz</li><li>Proje hakkında meta bilgilerini tutabiliriz</li><li>Projeleri Kaynak Kodu Yönetim Sistemlerine(Git, SVN) kolayca entegre edebiliriz</li></ul><h3>Temel Kavramlar</h3><p>Elbette her konuda olduğu gibi Maven’ı anlamanız için bilmeniz gereken bazı temel kavramlar yer almakta. Şimdi bunları sırası ile ele alalım.</p><h3>POM Dosyası</h3><p>Project Object Model(POM) dosyası aslında, hem proje hakkında bilgileri hemde projenin konfigürasyonu hakkında, bağımlılıkları, kaynağı, kullanılan pluginler, projeyi derlemek için gerekli komutlar vb. Bilgi içeren bir dosyadır. Eğer bir proje üzerinde Maven komutlarını kullanmak istiyorsanız, o projenin POM.xml dosyasını vermeniz gerekmektedir. Maven bütün işlemleri bu POM.xml dosyasını baz olarak yapar. Bu yazı Maven ile tanışma yazısı olduğu için fazla detaya girmeyeceğim, ancak bu POM.xml dosyasının iç yapısını daha detaylı bir şekilde anlatan bir yazı daha yazmayı planlıyorum. İlgili yazı sitemize eklendiğinde burada sizinle ilgili linki paylaşacağım.</p><h3>Dependencies and Repositories</h3><p>Bir java uygulaması geliştirdiğimizde, yer yer başka JAR dosyalarını projenize eklersiniz. Ya da geliştirdiğiniz projeyi destekleyen küçük küçük kütüphaneler yazarsınız. Eğer sizin bir projeniz, herhangi biri tarafından yazılmış başka bir kütüphaneyi kullanıyorsa, bu kütüphane sizin projenizin bağımlılığıdır. Maven dünyasında bu bağımlılıklar <strong>Dependency </strong>olarak isimlendirilmiştir.</p><p>Repository kavramı ise bu bağımlılıkların bulunduğu yer olarak tanımlayabiliriz. Çoğu zaman Maven’ın kendi sunmuş olduğu Central Maven Repository üzerinden Maven sizin için bağımlılıkları çeker. Central Maven Repository’i kullanmak için herhangi bir ayar yapmanız gerekmez. Zaten öntanımlı olarak Maven orayı kullanır. Ancak siz isterseniz, kendi repositorynizi kurabilirsiniz. Tek yapmanız gereken bunu POM.xml’de tanımlamak.</p><h3>Build Life Cycles, Phases and Goals</h3><p>Build Life Cycle, peşi sıra gelen Build Phase’leri temsil eder ve her bir Build Phase’de birden fazle Goal vardır. Örnek vermek gerekirse, <strong>clean</strong> ve <strong>package</strong> Maven goalleridir. Bir tanesi paketlenmiş(build edilmiş) dosyaları siler, diğer goal ise projeyi yeniden derler ve paketler.</p><h3>Build Plugins</h3><p>Build Plugin’ler spesifik olarak kendinize özgü Build Goal’ler tanımlamanızı sağlar. Hali hazırda, oldukça işlevsel olan bir sürü plugin’i işiniz düşütüğü zaman bulabilirsiniz. Ancak eğer kendim Maven plug-in yazmak istiyorum derseniz, özgürsünüz. Java ile istediğiniz plug-in’i yazabilirsiniz.</p><h3>Kaynakça</h3><p>Yazıyı yazarken kullandığım ağırlıklı olarak aşağıdaki kaynağı kullandım. Eğer konuya ilgili iseniz kullanmış olduğum kaynağıda inceleyebilirsiniz.</p><p><strong>Kaynak:</strong> <a href="https://www.geeksforgeeks.org/introduction-apache-maven-build-automation-tool-java-projects/">https://www.geeksforgeeks.org/introduction-apache-maven-build-automation-tool-java-projects/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab0f6ff91f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/bu-yaz%C4%B1n%C4%B1n-amac%C4%B1-maven-ile-siz-okurlar%C4%B1-tan%C4%B1%C5%9Ft%C4%B1rmakt%C4%B1r-aab0f6ff91f4">Bu yazının amacı Maven ile siz okurları tanıştırmaktır.</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PostgreSQL ve PgAdmin4 Docker Container Kurulumu]]></title>
            <link>https://medium.com/yazilim-vip/postgresql-ve-pgadmin4-docker-container-kurulumu-dda8940908d5?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/dda8940908d5</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[pgadmin]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sun, 30 Jun 2019 13:09:31 GMT</pubDate>
            <atom:updated>2022-10-09T00:57:04.125Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/855/0*7Z5YAkK602nFbpAC" /></figure><p>California Üniversitesinde 1986′ yılında temelleri atılan ve 30 yıldan fazla aktif bir gelişime sahip PostgreSQL yani kısaca Postgres, SQL dilini geliştirerek kullanan, verileri hızlı ve güvenli bir şekilde tutan açık kaynaklı, obje tabanlı ilişkisel (ORDBMS — Object relational database management system) bir veritabanı yönetim sistemidir. PostgreSQL ile ilgili daha detay bilgi isterseniz aşağıdaki linki inceleyebilirsiniz.</p><p>Link: <a href="http://yazilim.vip/2018/08/28/postgresql-nedir-neden-postgresql-veritabani-kullanmaliyiz/">http://yazilim.vip/2018/08/28/postgresql-nedir-neden-postgresql-veritabani-kullanmaliyiz/</a></p><p>pgAdmin4 Postgres veritabanlarını yönetmek için popüler bir uygulamadır. Tüm PostgreSQL özellikleri bu uygulama tarafından desteklenmektedir. Kullanıcı, pgAdmin ağaç denetimini kullanarak kolayca yeni bir kullanıcı veya rol ve postgres veritabanı oluşturabilir. pgAdmin4 ile ilgili daha detaylı bilgiyi aşağıdaki linkten bulabilirsiniz.</p><p>Link: <a href="https://linuxhint.com/pgadmin4_tutorial_beginners/">https://linuxhint.com/pgadmin4_tutorial_beginners/</a></p><p>PostgreSQL ve PgAdmin4 Docker Container Kurulumu için gerekli adımları neden aynı yaı altında paylaştığımı soracak olursanız, bunların çoğu zaman birlikte kullanıldığını düşünüyorum. Bir PostgreSQL sunucusu kurduğunuzda çoğu zaman bunu yönetmek isteyeceksiniz ve PgAdmin4 en kolay ulaşabileceğiniz PostgreSQL veritabanı yönetim uygulaması.</p><p>Bu yazımızda PostgreSQL ve PgAdmin4 Docker Container Kurulumu için gerekli adımları bir bir anlatmaya çalışacağım.</p><p>İlk olarak PostgreSQL veritabanını docker ile nasıl kurulduğunu, ardından kurulan PostgreSQL’i yönetmek için pgAdmin4’ün docker ile nasıl kurulduğunu aşama aşama anlatıyor olacağım.</p><h3>1 Docker CLI kurulumu</h3><p><strong>Pacman:</strong> sudo pacman -S docker</p><p><strong>APT:</strong> sudo apt-get install docker.io</p><h3>2 PostgreSQL Docker Container Olarak Kurmak</h3><p>Yapılması gereken adımlar kısaca aşağıdaki gibidir:</p><h3>2.1 PostgreSQL Container Deploy etmek</h3><p>örnek PostgreSQL’in</p><ul><li>çalışacağı port : <strong>5432</strong></li><li>postgres(admin) kullanıcısının şifresi: <strong>pos</strong></li><li>Container’ın adı: <strong>postgres</strong></li></ul><p>gerekli PostgreSQL Container’ını oluşturmak için gerekli komut aşağıdaki gibidir:</p><pre>docker run -p 5432:5432 --name local-postgres \<br>       -e POSTGRES_PASSWORD=pos \<br>       -d postgres</pre><p>Komutu çalıştırdıktan sonra öncelikle Docker için gerekli Postgresql imajı DockerCLI tarafından indirelecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SyVP-e--vC2skkvq" /></figure><p>İndirme işlemi tamamlandıktan sonra aşağıdaki gibi bir çıktı göreceksiniz. En alttaki 4bc35ed… diye devam eden id PostgreSQL’in çalıştığı container id değeridir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/0*5IXctFL3veAmtNrV" /></figure><p>Eğer buna benzer bir çıktı aldıysanız kurulum tamamlanmış demektir. Şimdi docker ps komutunu çalıştıralım ve şu an çalışan Containerları listeleyelim. Çıktı aşağıdaki gibi olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ho0_VWp-Pht-D6x7" /></figure><p>Eğer container UP running olarak görünüyorsa PostgreSQL çalışıyor demektir.</p><p>Container’ı başlatmak durdurmak yada silmek istediğimizde Container ID değerini kullanmanız yeterli olucaktır.</p><p>Durdurmak için : docker stop &lt;CONTAINER ID&gt;</p><p>Başlatmak için : docker start &lt;CONTAINER ID&gt;</p><p>Silmek için : docker rm -vf &lt;CONTAINER ID&gt;</p><h3>3 PgAdmin4 Docker Container Olarak Kurmak</h3><p>Yapılması gereken adımlar kısaca aşağıdaki gibidir:</p><h3>3.1 PostgreSQL Container Deploy etmek</h3><p>örnek pgAdmin4’ün</p><ul><li>Container adı: pgadmin4</li><li>çalışacağı port : <strong>9000</strong></li><li>Admin kullanıcısının kullanıcı adı: <strong>admin</strong></li><li>Admin kullanıcısının kullanıcı şifresi: <strong>0</strong></li></ul><p>gerekli pgAdmin4 Container’ını oluşturmak için gerekli komut aşağıdaki gibidir:</p><pre>sudo docker run -p 9000:80 --name pgadmin4  \<br>       -e &quot;PGADMIN_DEFAULT_EMAIL=admin&quot; \<br>       -e &quot;PGADMIN_DEFAULT_PASSWORD=0&quot; \<br>       -d dpage/pgadmin4</pre><p>Komutu çalıştırdıktan sonra öncelikle Docker için gerekli pgAdmin4 imajı DockerCLI tarafından indirelecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7bPIab0cILp2QNBI" /></figure><p>İndirme işlemi tamamlandıktan sonra aşağıdaki gibi bir çıktı göreceksiniz. En alttaki 3346ba… diye devam eden id pgAdmin’in çalıştığı container id değeridir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*pl44G9BjLkr2g20h" /></figure><p>Eğer buna benzer bir çıktı aldıysanız kurulum tamamlanmış demektir. Şimdi docker ps komutunu çalıştıralım ve şu an çalışan Containerları listeleyelim. Çıktı aşağıdaki gibi olacaktır. Dikkat ettiyseniz bir adım önce kurduğumuz PostgreSQL container’ını da görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cyzMHYVCu4L6gxHk" /></figure><p>Eğer container UP running olarak görünüyorsa pgAdmin4 çalışıyor demektir.</p><p>Container’ı başlatmak durdurmak yada silmek istediğimizde Container ID değerini kullanmanız yeterli olucaktır.</p><p>Durdurmak için : docker stop &lt;CONTAINER ID&gt;</p><p>Başlatmak için : docker start &lt;CONTAINER ID&gt;</p><p>Silmek için : docker rm -vf &lt;CONTAINER ID&gt;</p><p>Artık tarayıcınız üzerinde linki açarsanız pgAdmin4’in login sayfasını göreceksiniz. <a href="http://localhost:9000/">http://localhost:9000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uw0TRIPmp3ovI5aI" /></figure><p>Kullanıcı bilgilerini girdikten sonra aşağıdaki gibi bir sayfayla karşılaşacaksınız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x_9kf1vdYbu_dYjw" /></figure><p>Şu an elimizde halihazırda bir PostgreSQL sunucusu ve PostgreSQL sunucularınızı yönetebileceğimiz pgAdmin4 uygulamasını docker üzerinde container olarak başarılı bir şekilde kurmuş olduk.</p><p>pgAdmin4 hakkında daha detaylı bir yazımız sitemize eklendiği zaman burda paylaşacağım. Şimdilik esen kalın.</p><p>Yazının orjinalini aşağıdaki linkte sitemizde bulabilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dda8940908d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/postgresql-ve-pgadmin4-docker-container-kurulumu-dda8940908d5">PostgreSQL ve PgAdmin4 Docker Container Kurulumu</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bash Scriptlerine Autocomplete Özelliği Eklemek]]></title>
            <link>https://medium.com/yazilim-vip/bash-scriptlerine-autocomplete-%C3%B6zelli%C4%9Fi-eklemek-18d71a0c1ed4?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/18d71a0c1ed4</guid>
            <category><![CDATA[bash-autocompletion]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sat, 29 Jun 2019 15:37:34 GMT</pubDate>
            <atom:updated>2022-10-09T00:57:24.622Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*WF8jUu1S-9LM60yhgPReXw.png" /></figure><p>Bu yazımda, başlıktan da anlaşılacağı üzere bash scriptlerine autocomplete özelliği eklemek hakkında edindiğin bilgi ve deneyimleri size aktarmaya çalışacağım. Ancak anlatmaya başlamadan önce bazı kavramların üzerinden geçmek istiyorum.</p><h3>2 Bash Script</h3><p>Öncelikle, daha önce bash üzerinde script yazmak ile ilgili daha önceden deneyiminiz yoksa öncelikle konu hakkında bilgi almak adına, bash script nedir? Nasıl ve neden kullanılır? Gibi temel konuları anlamış olarak yazıyı okumaya devam edersiniz sizin için daha faydalı olacağını düşünüyorum. Ancak kısaca bash script nedir?</p><p>Bash script sayesinde, sık sık karşılaşılan durumlar için kullanıcı müdahalesine gerek kalmadan işlemlerin otomatikleştirilmesi sağlanabilir. Her gün belli zamanlarda sisteminizin tüm dosyalarının kontrol edilerek içlerinden sadece bir önceki güne göre değişenlerin yedeğini alan bir program yazılabilir. Bu tür işlemleri her gün kullanıcı manuel olarak yapabileceği gibi bir programa da yaptırabilir.</p><p>Kaynak: <a href="https://siberoloji.github.io/linux-ile-bash-script-temelleri/">https://siberoloji.github.io/linux-ile-bash-script-temelleri/</a></p><p>Daha fazla örnek bash scriptleri için aşağıdaki link ineleyebilirsiniz.</p><p>Link: <a href="http://yazilim.vip/?p=1975&amp;preview=true">https://linuxhint.com/30_bash_script_examples/</a></p><h3>3 Bash Autocompletion</h3><p>Bash autocompletion çalışma prensibi, öncelikle komut satırına girilen komutu çözümlemek ve çözümlenen komutun nasıl tamamlanabileceğini tanımlamak şeklindedir. Terminal’i açıp bir komut yazdığınız zaman çoğu zaman, klavyede TAB tuşuna basarak yazdığınız komutun tamamlanmasını beklersiniz. Aslında, Linux’u çok kısa bir süre deneyimlemiş iseniz, en sık kullandığınız komutlardan bir tanesi <strong>cd</strong> komutudur. Çoğu zaman bu komutu kullanırken klavyede TAB karakterine basa basa ilerlersiniz, <strong>cd </strong>yazarsınız. TAB’a basınca o dizindeki klasörler listelenir, klasörü yazarsınız, tekrar TAB’a basarsınız ve böyle böyle devam edersiniz. Başka bir örnek vermek gerekirse, mesela <strong>pacman</strong> paket yöneticisi üzerinden Opera’yı kurmaya çalıştığınızı varsayalım. Aşağıdaki görseldeki gibi komutun bir kısmını yazarız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*_BRFmQcX9ITTF27R" /></figure><p>Ardından klavyeden tab tuşuna basarız ve bash bize olası <strong>ope </strong>ile başlayan olası paketleri aşağıdaki gibi listeler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*LSvx0Ck6zGpUmkOx" /></figure><p>Bu işlem Bash Autocompletion özelliği sayesinde gerçekleşmektedir.<br>Daha detaylı bilgiyi aşağıdaki linklerden bulabilirsiniz.</p><p>Link: <a href="https://unix.stackexchange.com/questions/205360/how-does-bash-auto-completion-work">https://unix.stackexchange.com/questions/205360/how-does-bash-auto-completion-work</a></p><p>Link: <a href="http://www.gnu.org/software/bash/manual/bash.html#Programmable-Completion">http://www.gnu.org/software/bash/manual/bash.html#Programmable-Completion</a></p><h3>4 Autocomplete Scriptinin Ayarlanması</h3><p>Bash üzerindeki <strong>cd, ls, pacman </strong>gibi temel komutlar için bash autocomplete işlemini gerçekleştirecek şekilde ayarlanmış. Peki biz kendi yazmış olduğumuz bash scriptler için hangi ayarları yapmamız gerek ki bash üzerinde istediğimiz seçenekler TAB’a bastığımız zaman listelenebilsin.</p><p>Öncelekile örnek bir senaryo belirleyelim. Sunucularımıza terminal üzerinden uzaktan bağlantı yapabilmemiz için gerekli komutların bulunduğu bir script olsun. Bunun için aşağıdaki bir script’imiz olduğunu varsayalım.</p><pre>connect_server(){<br>    case &quot;$1&quot; in<br>        server1)<br>            echo &quot;connecting to server 1&quot;<br>            ;;<br>         <br>        server2)<br>            echo &quot;connecting to server 2&quot;<br>            ;;</pre><pre>        localsv1)<br>			echo &quot;connecting to local server 1&quot;<br>            ;;</pre><pre>        localsv2)<br>			echo &quot;connecting to local server 2&quot;<br>            ;;</pre><pre>        *)<br>            echo $&quot;Usage: $0 {server1|server2|localsv1|localsv2}&quot;<br>            exit 1<br>	esac<br>}</pre><p>Yukarıdaki scriptte görüldüğü gibi 4 farklı sunucumuz bulunmakta. Şimdi konumuza dönecek olursak, scirpt’i çalıştırırken serverlar otomatik olarak seçilebilecek sunucular gösterilse oldukça kullanışlı olurdu. Örneğin:</p><p><strong>connect_server loc </strong>terminal’e yazıldığında TAB’a basınca <strong>loc </strong>ile başlayan sunucular listelensin.</p><p>Öncelikle Bunun için bir autocomplete scripti tanımlamamız gerekiyor. Ardından bu scripti bizim connect_server script’imize bağlamamız gerekiyor. Autocomplete script’ini aşağıda bulabilirsiniz.</p><pre>_connect_server_complete() {<br>    local cur prev opts<br>    COMPREPLY=()<br>    cur=&quot;${COMP_WORDS[COMP_CWORD]}&quot;<br>    prev=&quot;${COMP_WORDS[COMP_CWORD-1]}&quot;</pre><pre>    opts=&quot;server1 server2 localsv1 localsv2&quot;</pre><pre>    COMPREPLY=( $(compgen -W &quot;${opts}&quot; -- ${cur}) )<br>}</pre><p>Ardından aşağıdaki komut çalıştırılarak bu autocomplete script’i connect_server scripti ile bağlanacak.</p><pre>complete -F _connect_server_complete connect_server</pre><p>Şimdi elimizdekileri bir sh uzantılı bir script dosyasında bulunduracak olursak aşağıdaki gibi bir sonuç ortaya çıkacak. Script’i snippet olarak GitLab üzerinde paylaşmış bulunmaktayım. Script’in tam halini aşağıda ki linkte bulabilirsiniz.</p><p><a href="https://gitlab.com/snippets/1870484">Bash-Autocomplete ($1870484) · Snippets</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18d71a0c1ed4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/bash-scriptlerine-autocomplete-%C3%B6zelli%C4%9Fi-eklemek-18d71a0c1ed4">Bash Scriptlerine Autocomplete Özelliği Eklemek</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Dünyasına Giriş! Linux Kavramları]]></title>
            <link>https://medium.com/yazilim-vip/linux-d%C3%BCnyas%C4%B1na-giri%C5%9F-linux-kavramlar%C4%B1-c975fbacaa06?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/c975fbacaa06</guid>
            <category><![CDATA[linux-kavramları]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-terimleri]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Thu, 07 Feb 2019 08:09:18 GMT</pubDate>
            <atom:updated>2022-10-09T00:57:56.071Z</atom:updated>
            <content:encoded><![CDATA[<p>Linux Kavramları eğer Linux dünyasına giriş yapıcaksınız oldukça önemlidir. Bu yazımızda sizlere Linux dünyasında oldukça yaygın olarak karşılaşacağınız Linux Kavramlarından bahsediyor olacağım. Yazıya başlamadan önce Eğer Linux dünyasına yeni adım adıyorsanız <a href="https://medium.com/@maemresen07/linux-d%C3%BCnyas%C4%B1na-giri%C5%9F-linuxa-nas%C4%B1l-ba%C5%9Flar%C4%B1m-cb8074dcf3ca">Linux’a Nasıl Başlarım?</a> başlıklı makalemi okuyabilirsiniz. Yazının sonunda yukarıdaki Linux Kavramları hakkında bir fikir sahibi olursunuz diye umuyorum. Hazırsak ilk maddemiz ile başlayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*KRiCkSWxs-INftWX.png" /></figure><h3>GNU/Linux</h3><p>Linux Kavramları içerisinde belkide en temel olan kavram GNU’dur. GNU, özgür yazılım olan bir işletim sistemidir –yani, kullanıcıların özgürlüğüne saygı duyar. GNU işletim sistemi özgür yazılım olarak yayınlanan üçüncü partı tarafından geliştirilen GNU paketlerinden (GNU projesi tarafından yayınlanan programlar) dan oluşmaktadır. GNU’nun gelişimi, özgürlüğünüze zarar verecek bir yazılım olmadan bilgisayar kullanılmasını mümkün kıldı. Bu konunun daha derinlerine inen bir yazı daha yazmayı planlıyorum. İlgili yazı eklendiğinde buraya ilgili linki ekleyeceğim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*YKJlLzrmzVVJX4h7tViCAA.png" /></figure><p>GNU’nun özgün çekirdeği Hurd, günlük kullanım için hazırdır. Ayrıca GNU, günümüzde genel anlamda Linux Çekirdeği ile de kullanılmaktadır. Bu kombinasyon GNU/Linux olarak isimlendirilir. Pek çok kişi yanlış biçimde “Linux” diyor ama GNU/Linux milyonlarca insan tarafından kullanılan sistemin doğru adıdır.</p><p>Bu yazı kapsamında bu özet bilgi şimdilik yeterli olacaktır. Eğer daha detaylı bilgi almak istiyorsanız aşağıdaki linkte “<strong>GNU Araç Setleri (GNU Utilities)</strong>” isimli başlığı okuyabilirsiniz.</p><p><strong>Link:</strong> <a href="https://teknopusula.com/linux-nedir-kernel-gnu-ve-masaustu-ortamlari-ne-ise-yarar-6295/">https://teknopusula.com/linux-nedir-kernel-gnu-ve-masaustu-ortamlari-ne-ise-yarar-6295/</a></p><h4>Kaynakça</h4><p><strong>Link:</strong> <a href="https://www.gnu.org/">https://www.gnu.org/</a></p><p><strong>Link:</strong> <a href="http://www.getgnu.org/gnulinux/gnulinux-ipuclari/gnu-nedir.html">http://www.getgnu.org/gnulinux/gnulinux-ipuclari/gnu-nedir.html</a></p><h3>Linux Shell</h3><p>Shell’de aynı GNU gibi Linux Kavramları arasında önemli bir yere sahiptir. Öncelikle Shell (Kabuk) nedir bununla başlayalım.</p><h4>Shell (Kabuk)</h4><p>Basitçe söylemek gerekirse, kabuk, klavyeden komutları alan ve bunları gerçekleştirmek için işletim sistemine veren bir programdır. Eskiden Linux gibi Unix benzeri bir sistemde mevcut olan tek kullanıcı arabirimi bu kabuklardı. Günümüzde, kabuk olarak komut satırı arabirimlerine (CLI) ek olarak grafik kullanıcı arabirimleri (GUI) vardır.</p><p><strong>GUI Hakkında detaylı bilgi: </strong><a href="https://wmaraci.com/nedir/gui">https://wmaraci.com/nedir/gui</a></p><p>Birçok Linux Kabuğu bir Linux sistemi üzerinde kullanılabilir ancak bu kabuklardan bitanesi neredeyse tüm Linux dağıtımlarında kullanılmaktadır. Bu kabuk “Bash” olarak adlandırılır.</p><h4>Bash — (Bourne again shell)</h4><p>Bash kabuğu <strong>Unix</strong> kabuğunun yerine geçecek şekilde GNU projesi kapsamında geliştirilmiştir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*3vwf6GVZqfduMK1yFeiRJg.png" /></figure><p>Bash ile ilgili daha detaylı yazım eklendiği zaman ilgili linki buraya ekleyeceğim. Şimdilik bu kadar bilgi işin mantığını anlamanız için yeterli olacaktır</p><h3>Uç Birim (Terminal)</h3><p>Linux Kavramları hakkında temel bir konu daha. Esasen Komut Satırı olarak adlandırılan ancak sıkça konsol, terminal, kabuk gibi de adlandırılan, kullanıcının komutların bilgisayar ile iletişime geçmesini sağlayan ara yüze Uç Birim denir. Temelde bu Uç Birimler ikiye ayrılır.</p><h4>Konsol Terminalleri</h4><p>Linux işletim sistemini Text Modunda açtıktan sonra karşımıza gelen terminal arayüzüne denir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*rMtRp-dYcfTGc3fZByizrQ.png" /></figure><h4>Grafiksel Terminaller</h4><p>Grafiksel Terminal açabilmek için çalıştırdığınız Linux tabanlı işletim sisteminde bir Masaüstü Ortamı (Desktop Environment) kurulu olması gerekmektedir. Örn: GNOME’da GNOME Terminal, KDE’de Konsol vs vs.</p><p><strong>Not: </strong>Masaüstü Ortamlarına yazının ilerleyen kısımlarında değineceğim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*V72ZdeR7GewirXV4ILDG_g.png" /></figure><h4>Kaynakça</h4><p><strong>Link:</strong> <a href="http://linuxcommand.org/lc3_lts0010.php">http://linuxcommand.org/lc3_lts0010.php</a></p><p><strong>Link:</strong> <a href="https://teknopusula.com/linux-shell-nedir-linux-komut-satiri-nasil-kullanilir-6347/">https://teknopusula.com/linux-shell-nedir-linux-komut-satiri-nasil-kullanilir-6347/</a></p><h3>Komutlar</h3><p>Komutlar Linux dünyasının ayrılmaz bir parçasıdır. Hatta şöyle bir söz vardır.</p><blockquote><strong><em>Linux commands do a little of everything</em></strong></blockquote><p>Elbette GUI kullanarak’ta işlerinizi halledebilirsiniz. Ancak, komut satırına alıştığınız zaman aslında çoğu işlem için GUI ihtiyacı olmadığını anlayacaksınız.</p><p>İşin özü şu. Her ne kadar GUI olsada, eninde sonunda bu arka taraflarda bir takım komutlar siz butonlara bastığınızda tetikleniyor. Linux ortamında bu komutlar oldukça kullanışlı olabiliyor. Hatta bu komutları bir araya getirerek daha sonra yine kullanmak üzere bir dosyaya kaydedebilirsiniz. Bu komut setinin olduğu dosyaya script dosyası denir.</p><h4>Temel Komutlar</h4><p>Kullanılabilecek tonlarca fazla Linux komutu var. Elbette hepsini tek seferde öğrenemezsiniz. Kendim adıma konuşayım daha komutların bir çoğunu ezbere bilmiyorum ki bilmekte gerekmiyor. Ancak bazı temel komutlar standart olarak sıkça kullanılıyor. Bu komutları öğrenerek işe başlamanızın sizin adınıza yararlı olacağına inanıyorum. Bu temel komutları ele aldığım bir yazı yazacağım. İlgili yazımı tamamladığımda linkini buraya ekleyeceğim.</p><h3>Root</h3><p><strong>root</strong> kelimesi Unix-benzeri işletim sistemlerinde birkaç farklı anlama gelmektedir. Bu yüzden Unix-benzeri işletim sistemlerine yeni giriş yapan insanlar <strong>root</strong> kavramını karıştırabiliyor.</p><p><strong>root</strong>, varsayılan olarak bir Linux veya diğer Unix benzeri bir işletim sistemindeki tüm komutlara ve dosyalara erişime sahip olan kullanıcı adı veya hesaptır. Kök hesabı, kök kullanıcı ve süper kullanıcı olarak da anılır.</p><p>Bir diğer anlamı da sistemdeki en üst dizin olan <strong>root</strong> dizindir. Yani, alt dizinleri ve dosyaları da dahil olmak üzere tüm diğer dizinlerin bulunduğu dizindir. <strong>root</strong> dizini bir eğik çizgi <strong>(/)</strong> ile belirtilir.</p><h3>Paket Yöneticisi</h3><p>Modern Linux tabanlı işletim sistemleri yazılımları derlenmiş paketleri kullanarak kurar. Derlenmiş Paketler diyerek ilgili yazılımın Binary’leri, ayar dosyaları ve gerekli bağımlılık bilgilerini içeren dosyalar kastedilmektedir. İşin en kritik kısmı bağımlılıkların yönetiliyor olması. Eğer bir yazılımı paket yöneticisi olmadan kuracaksanız:</p><ol><li>kurulumu tamamlamak için gerekli tüm bağımlılıkların güncel sürümlerinin kurulduğundan emin olmamız gerekmektedir.</li><li>Yazılımı kaynak kodundan çekip derlemelisiniz (bu vakit alan bir işlemdir)</li><li>kurulan her bir yazılımın ayarlamalarının yapılması</li></ol><p>Paket yönetim sistemleri bu ve buna benzer problemleri çözmek, Linux tabanlı bir işletim sisteminin genel kalitesini ve tutarlılığını artırmaya çalışın. için geliştirilen araçlara verilen isimdir.</p><p>Paket Yöneticisi konusunda Linux dağıtımları arasında ciddi bir ayrım söz konusudur. Çoğu dağıtımın kendine has paket yöneticisi vardır.</p><p><strong>örn:</strong></p><ul><li>Debian: APT, Aptitude, Synaptic,</li><li>Arch: Pacman</li><li>Redhat: YUM, DNF</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*QPqKbqhpRTRR2I8VeM4jjw.png" /><figcaption>APT ile Program Kurulum İşlemi</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*nQ-sxWcLaHThLTU4s3ADyQ.png" /><figcaption>APT ile Program Kaldırma İşlemi</figcaption></figure><h4>Kaynakça</h4><p><strong>Link:</strong> <a href="https://www.linode.com/docs/tools-reference/linux-package-management/">https://www.linode.com/docs/tools-reference/linux-package-management/</a></p><h3>Desktop Environment</h3><p>Öncelikle şu soruya cevap verelim. Desktop Environment nedir?</p><p>Tüm eylemimiz, bir masaüstü ortamının ne olduğu bir grafik kullanıcı arayüzü ile gerçekleşir. Dosya yöneticiniz, pencereler, giriş ekranları, çeşitli menüler, fare işaretçisi, tüm bu işlemleri bizim için yöneten ve çekirdekle konuşmamızı sağlayan Desktop Environment’tir.</p><p>Linux tarafında masaüstü ortamı (Desktop Environment) konsepti çok güzel işlenmiştir çünkü tüm yapı modüler olarak tasarlanmıştır. Öyleki düzinelerce farklı, resmi olarak desteklenen masaüstü ortamı vardır.</p><ol><li>Bu masaüstü ortamlarını birleştirip kendi masaüstü ortamınızı oluşturabilirsiniz. Elbette bu iş biraz deneyim ve uzmanlık gerektiren bir iş ancak imkansız değil.</li><li>Bir Linux dağıtımı kullanırken birden fazla masaüstü ortamı kurabilirsiniz. Ancak bunu yapmanızı pek tavsiye etmem. Şahsen ben denediğim zamanlar pek verim alamadım.</li></ol><p>Elbette tüm bu dağıtımlar içerisinde öne çıkan bir kaç tane var. Bu masaüstü ortamları genellikle Linux Dağıtımları tarafından desteklenmektedir. Gerek resmi olarak gerekse topluluk tarafından. Bunlar:</p><ul><li>GNOME</li><li>Xfce4</li><li>KDE</li></ul><p>Özellikle GNOME masaüstü ortamlarının atasıdır diyebiliriz. İsminin ilk harfi olan G, GNU Projesini temsil eder. Yani GNOME, GNU kapsamında geliştirilen projelerden bir tanesidir. Amacı Linux tabanlı işletim sistemlerinin son kullanıcıya daha çok hitap edilebilir hale getirmektir.</p><p><strong>Link:</strong> <a href="https://www.forbes.com/sites/jasonevangelho/2018/09/17/linux-for-beginners-whats-a-desktop-environment/#17b0e2421b0a">https://www.forbes.com/sites/jasonevangelho/2018/09/17/linux-for-beginners-whats-a-desktop-environment/#17b0e2421b0a</a></p><h3>Linux Dağıtımları, Flavor</h3><h4>Flavor</h4><p>Flavor yada genellikle “flavor of UNIX” olarak geçen bu kavram Unix tabanlı işletim sistemleri için kullanılır. İşin özeti Linux, Unix tabanlı bir işletim sistemidir, yani bir Unix Flavor’udur.</p><h4>Linux Dağıtımı</h4><p>Bir başka önemli Linux Kavramı daha. Türkçe adıyla Linux Dağıtımı ya da sıkça karşılaşabileceğiniz deyişle Linux Disto’ları nedir bu kavramın üzerinde duralım.</p><p>Öncelikle şunu belirtmek isterim ki Linux tek bir kuruluş tarafından üretilen bir ürün değildir. Farklı kuruluşlar farklı kısımlarını geliştirmektedir. Peki nedir bu farklı kısımlar. Linux Çekirdeği, GNU Shel Utilities, X server, Desktop Environment vb. Tüm bu parçaların hepsi tamamen açık-kaynak kodlu bir şekilde paylaşılmaktadır.</p><p>İsterseniz, Linux çekirdeği, GNU kabuk yardımcı programları, Xorg X server ve Linux sistemindeki diğer tüm programların kaynak kodlarını alabilir ve bunları kendiniz toplayabilirsiniz. Ancak, yazılımı derlemek çok zaman alacaktır — tüm farklı programların birlikte düzgün bir şekilde çalışmasını sağlamaktan bahsetmiyorum bile.</p><p>Linux dağıtımları sizin için zorlu bir iş yapar, yani açık kaynaklı projelerin tüm kodlarını alarak ve sizin için derleyip, önyükleyebileceğiniz ve kurabileceğiniz tek bir işletim sistemi olarak toparlar. Ayrıca, varsayılan masaüstü ortamı, tarayıcı ve diğer yazılımları seçmek gibi sizin için seçimler yaparlar. Çoğu dağıtım, temalar ve özel yazılımlar gibi kendi son rötuşlarını ortaya çıkan derlenmiş ürüne ekler. — örneğin Ubuntu’nun Unity masaüstü ortamı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*1DZCuKV-rY7Nw4ylWb4bzg.png" /></figure><p>Ufak bir araştırma yaparsanız bir sürü farkı dağıtım olduğunu fark edeceksiniz. Dağıtımların arasında bir karar vermeniz tahmin ettiğinizden fazla zamanınızı alabilir. Bunun önüne geçmek için yazının devamını okumanızı tavsiye ederim.</p><h4>Kendi Kullandığım Dağıtım</h4><p>Eğer bana sorucak olursanız size henüz net bir cevap veremem. Ancak kullandığım dağıtımları şöyle sıralayabilirim:</p><ol><li>Ubuntu</li><li>ArchLinux</li><li>Manjaro</li></ol><p>Arada denediğim başka dağıtımlar elbette oldu. Sunucular için Centos, masaüstü kullanım için Fedora, Mint vb. Burda listelenen dağıtımlar gerçekten belirli bir süre kullandığım dağıtımlar. En son aktif olarak kullandığım dağıtım Manjaro. Ancak dediğim gibi hala net değilim. Şimdilik, paket yöneticisinden (Pacman) ve sunduğu desktop environment’lardan biri olan KDE’den memnunun. İhtiyacımı karşıladığı müddetçe hiç bir sorun yok.</p><p>Belki farklı bir alana yönlenirim ve artık Manjaro benim isteklerimi karşılamaz. O zaman Fedora’ya geçerim. Tam bu noktada bir konuya değinmek istiyorum</p><h4>Hangi Dağıtımı Seçmeliyim?</h4><p>Hangi Dağıtım ile başlamalıyım? En iyi Dağıtım hangisidir? Bu tarz sorular ile boğuşmayın. Linkteki video’yu izlemenizi tavsiye ederim.</p><p><strong>Link:</strong> <a href="https://www.youtube.com/watch?v=3zpgQpdy_fI">Stop-Hopping-Distro</a></p><p>Sadece deneyin ve sonuçlarının gözlemleyin. Yukarıda bahsetmiş olduğum gibi, hangi dağıtım amacınıza hizmet ediyorsa o dağıtımı kullanın. Geri kalan detayları bir şekilde halledersiniz. Hangi dağıtımı seçerseniz seçin Linux tabanlı bir işletim sistemi kullanıyor olucaksınız. Komutlar açısından bir farklılık olmayacaktır. :)</p><p>Ayrıcı aşağıdaki linkten dağıtımların popülerliğini takip edebilirsiniz.</p><p><strong>Link:</strong> <a href="https://distrowatch.com/">https://distrowatch.com/</a></p><h4>Kaynakça</h4><p><strong>Link:</strong> <a href="https://www.howtogeek.com/132624/htg-explains-whats-a-linux-distro-and-how-are-they-different/">https://www.howtogeek.com/132624/htg-explains-whats-a-linux-distro-and-how-are-they-different/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c975fbacaa06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/linux-d%C3%BCnyas%C4%B1na-giri%C5%9F-linux-kavramlar%C4%B1-c975fbacaa06">Linux Dünyasına Giriş! Linux Kavramları</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Dünyasına Giriş! Linux’a Nasıl Başlarım?]]></title>
            <link>https://medium.com/yazilim-vip/linux-d%C3%BCnyas%C4%B1na-giri%C5%9F-linuxa-nas%C4%B1l-ba%C5%9Flar%C4%B1m-cb8074dcf3ca?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb8074dcf3ca</guid>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linus-torvalds]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Thu, 07 Feb 2019 07:56:56 GMT</pubDate>
            <atom:updated>2022-10-09T00:58:14.244Z</atom:updated>
            <content:encoded><![CDATA[<p>Yeni bir Linux kullanıcısının Linux Dünyasına Giriş yapmasını kolaylaştırmak adını böyle bir makale yazma gereği duydum. Konuya girmeden önce Linux ile ilk tanıştığım zamanları şöyle bir gözden geçiriyorum. İlk zamanlarda bana o kadar yabancı geliyordu ki. Üniversiteye başlayana kadar kendisiyle pek fazla münasebetim olmamıştı. Yarım yamalak bilgilerim vardı. UNIX, Linux yerli işletim sistemi PARDUS, Ubuntu vs. Bunun dışında tamamiyle Windows kullanıyor idim. Kavramlar sizede başta yabancı gelebilir. Bu çok doğal. Ancak önemli olan bu kavramları iyi oturtabilmek. İşin temelini oturtursanız geri kalanı çorap söküğü gibi geliyor. Bundan emin olabilirsiniz. Bu kavramlara yazının devamında değinicez. Ayrıca ilerleyen zamanlarda daha detaylı makalelerim olacak ancak şimdi asıl konumuza odaklanalım. Nedir bu Linux?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uRo52UrN72a-3Wkt.png" /></figure><h3>Linux Nedir</h3><p>Linux aslında 1991 yılında Finlandiyadaki Helsinki üniversitesinde son sınıf öğrencisi olan <strong>Linus Torvalds</strong> isimli öğrencinin geliştirdiği bir projedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/0*hcCgYz6SwMqW9fV5" /><figcaption>Linus Torvalds</figcaption></figure><p>Bu proje kapsamında kendi işletim sistemi çekirdeğini yazmıştır. Daha sonra komple bir işletim sistemi yapmak için gerekli bileşenleri yazmış olduğu çekirdek merkezde olacak şekilde toparladı. Ortaya çıkan bu ürün günümüzde bahsi geçen <strong>Linux</strong>’un ta kendisidir. Böylece Linux İşletim Sistemi ortaya çıkmış oldu.</p><p><strong>Not:</strong> Makaleye devam etmeden önce İşletim Sistemi Çekirdeği nedir? Çok kısa açıklamak istiyorum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/0*nzEzHxXH5XGEytsK" /></figure><p>Yukarıdaki görselden anlayabileceğiniz üzere, Bilgisayar iki temel kısımdan oluşur. (i) donanım (ii) yazılım. Donanım ve Yazılımın konuşmasını sağlayan katman ise işletim sistemi çekirdeğidir.</p><p>Yani çekirdeğin görevi, günlük hayatta kullandığımız uygulamaların bilgisayar donanım ile konuşmasını sağlayan arabuluculuk yapmaktır diyebiliriz. Tek bir cümle ile özetlemek gerekirse Linux Açık Kaynak Kod’lu bir işletim sistemi çekirdeğidir.</p><h3>Linux Felsefesi</h3><p>Linux işletim sisteminin elbette kendine göre bir takım felsefeleri vardır. Linux üzerine kurulan çoğu işletim sistemi bu felsefeye uymaktadır. Bu felsefeleri şöyle sıralayabiliriz:</p><ul><li>Hiyerarşik bir dosya sistemi vardır.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/0*F3y8xP_PDXKbFNOQ" /></figure><ul><li>Her bir nesne dosya benzeri bir yapıda tutulur</li><li>Çoklu işlem çalıştırabilien, Çoklu kullanıcı desteği olan bir işletim sistemidir</li></ul><figure><img alt="Çoklu İşlem" src="https://cdn-images-1.medium.com/proxy/0*AX_6e61gY9vmXBH1." /><figcaption>Çoklu İşlem</figcaption></figure><ul><li>Işlemler daemon’lar üzerinden yürür</li><li>Daemon = işletim sistemi tarafından arka planda sessizce çalıştırılan işlemler. <strong>Ör:</strong> servis işlemleri</li></ul><h3>Linux Topluluğu</h3><p>Linux kullanmanın en güzel yanlarından birisi, geniş bir kullanıcı topluluğunun olmasıdır. Yüzlerce, farklı topluluk mevcuttur. Bu topluluklar sayesinde, herhangi bir sorun yaşadığınızda yüksek ihtimalle biri o sorunu daha önceden yaşamıştır ve bir çözümü ulaşmıştır. Elbette daha önce çözülmemiş bir sorun çözerseniz sizinde bu çözümü ilgili topluluklarda paylaşmanız hoş bir hareket olucaktır :)</p><h3>Linux Terminolojisi</h3><p>Linux Dünyasına Giriş yapmak isterseniz tıpkı her yerde olduğu burda da kendine has bir takım terimler, kelimeler, ifadeler yer almakta. Binary dosyalar, komutlar, distrolar, flavors vs. Bu kavramlar uzar gider. Konu ile ilgili makale sitemize ekleneceği vakit bu yazı güncellenecektir. Yazıyı okumanızı tavsiye ederim. Yazının başında belirttiğim gibi, linux dünyasına giriş yaparken ilk başlarda yabancılık çekebilrsiniz. Bu hiç problem değil. Herkes ilk başladığında emin olun aynı zorlukları yaşamıştır.</p><p>Özellikle vurgulamak istediğim tek şey denemekten vazgeçmeyin. Bir sorunla karşılaşıcaksınız ancak çözümü bulmakta zorlanacaksınız. Bunun sebebi daha yeni yeni linux dünyasına giriş yapmış olmanız olacak. Bir süre sonra linux dünyasına alıştığınızı farkediceksiniz ve o çözülemeyen sorunlar bir bir azalacaktır.</p><p>Daha detaylı bilgi için Linux Türkiye Kullanıcıları Derneği’nin sayfasını inceleyebilirsiniz.</p><p><strong>Link :</strong> <a href="https://linux.org.tr/">https://linux.org.tr/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb8074dcf3ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/linux-d%C3%BCnyas%C4%B1na-giri%C5%9F-linuxa-nas%C4%B1l-ba%C5%9Flar%C4%B1m-cb8074dcf3ca">Linux Dünyasına Giriş! Linux’a Nasıl Başlarım?</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IntelliJ IDEA üzerinde Spring Boot Projesi Nasıl Açılır?]]></title>
            <link>https://medium.com/yazilim-vip/intellij-idea-%C3%BCzerinde-spring-boot-projesi-nas%C4%B1l-a%C3%A7%C4%B1l%C4%B1r-efd31792c7da?source=rss-d2b939c1b561------2</link>
            <guid isPermaLink="false">https://medium.com/p/efd31792c7da</guid>
            <category><![CDATA[jetbrains]]></category>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[MEHMET ARİF EMRE ŞEN]]></dc:creator>
            <pubDate>Sat, 22 Sep 2018 10:59:04 GMT</pubDate>
            <atom:updated>2022-10-09T00:58:33.459Z</atom:updated>
            <content:encoded><![CDATA[<p>IntelliJ IDEA ile Spring Boot Projesi nasıl açılır? Bu yazımda bu sorunun cevabını veriyor olacağım. Öncelikle IntelliJ IDEA’nın kurulumu ile başlayalım.</p><h3>IntelliJ IDEA Kurulum</h3><p>Kurulum işlemini Jetbrains’in kendi sitesinden takip ederek gerçekleştiebilirsiniz.</p><p><strong>Link :</strong> <a href="https://www.jetbrains.com/help/idea/install-and-set-up-product.html">https://www.jetbrains.com/help/idea/install-and-set-up-product.html</a></p><h3>IntelliJ IDEA ile Spring Boot</h3><p>Kurulum işlemini tamamladıktan sonra IntelliJ IDEA’yı açtığınız zaman aşağıdaki gibi bir ekranlaa karşılaşıcaksınız. Bu aşamada gördüğünüz gibi dört farklı seçenek mevcut.</p><p><strong>Create New Project : </strong>Eğer yeni bir proje oluşturmak istiyorsanız bu kısımdan devam edebilirsiniz. IntelliJ IDEA ile Spring Boot projesi oluşturma şansınızda var ancak bu konuyu başka bir makalemizde ele alıyor olacağız. Makalemiz yayına alındığında ilgili link makaleye eklenecektir.</p><p><strong>Open</strong> : Projenin yer aldığı klasörü doğrudan açabilirsiniz. Eğer daha önceden IntelliJ Üzerinde bir proje oluşturduysanız yada import ettiyseniz, daha sonradan o klasörü seçerek projenizi tekrardan açabilirsiniz.</p><p><strong>Check out from Version Control :</strong> bu seçenekte ise IntelliJ IDEA sizin için belirtmiş olduğunuz Versiyon Kontrol Sisteminden (<strong>Git, SVN </strong>vb.) projenizi çekip otomatik olarak import edebilmektedir ancak bu konuyu başka bir makalemizde ele alıyor olacağız. <a href="http://yazilim.vip/intellij-idea-ile-spring-boot-projesi/">http://yazilim.vip</a> altında konu ile ilgili makalemiz yayına alındığında ilgili link eklenecektir.</p><p><strong>Import Project :</strong> bu seçenek bizim bu yazıda ele aldığımız seçenek olacaktır. Elimizde bir Spring Boot projesi var ve IntelliJ IDEA ile Spring Boot projesini açmak istiyoruz. Bu durumda yapmamız gereken Spring Boot projesini IntelliJ IDEA üzerinde import etmek.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/0*PHhFm42nueCENuHd.png" /></figure><h3>Projeyi Import Etmek</h3><p>Import Project butonuna tıkladıktan sonra karşımıza aşağıdaki gibi bir ekran gelcektir. Burda import edilecek olan Spring Boot projesinin bulunduğu yeri seçiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*elhJj6XTPvckUnzn.png" /></figure><p>Doğru klasöürü seçip OK butonuna bastıktan sonra aşağıdaki ekranla karşılaşıyoruz. Burda bize ne tür bir proje’nin import edileceği soruluyor. Maven projesi olarak seçiyoruz ve devam ediyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*dNJJrjfvJI5DB1G6.png" /></figure><p>Ardından IntelliJ proje hakkında bir takım özellikleri bize göstericektir. Bu adımı hızlı bir şekilde geçebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/0*jW99u9oQ1N2uWAi0.png" /></figure><p>Bir sonraki adımda hangi Maven projelerinin import edileceği sorulacaktır. Şu an seçtiğimiz klasörde açmak istediğimiz Spring Boot projesi olduğu için aşağıdaki gibi sadece bir tane proje görüceksiniz.</p><h4>Çoklu Proje Import Etmek</h4><p>Anlayacağınız üzere eğer birden fazla Spring Boot Projesi import etmek isterseniz az önce klasör seçtiğimiz yerde tüm projelerin olduğu bir üst dizini seçip o klasör altındaki tüm projeleri import edebilirsiniz.</p><p><strong>Örn:</strong> /dizin/proje1 /dizin/proje2 böyle bir klasörünüz varsa /dizin klasörünü seçmeniz halinde aşğıdaki ekranda iki Spring Boot projesininde import edilebilir olduğunuz görüceksiniz.</p><p>Next butonuna tıklayıp sonraki sayfaya geçebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/0*buu_vAV8GDxWhA0t.png" /></figure><h3>Proje JDK Ayarları</h3><p>Bilgisayarınızda kurulu JDK IntelliJ tarafından algılanacak ve projede kulanılması için ayarlanacaktır. Bu aşamayıda hızlıca geçebilirsiniz. Eğer bu aşamada bir sıkıntı yaşıyorsanız ör: Herhangi bir JDK bulunamadıysa, JDK kurulumunuzu tekrar gözden geçirmenizi tavsiye ederim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*7G_uZ1LfAqZsnm9R.png" /></figure><p>Son olarak, projeyi IntelliJ IDEA’da hangi isimde import etmek istediğiniz sorulacak. Ön tanımlı olarak artifactId kısmına girdiğimiz değer yani <strong>console-application</strong> gösterilicektir. Bu ismi kullanabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*5I31JAvy-GXkjTT4.png" /></figure><h3>Projenin Derlenmesi ve Çalıştırılması</h3><p>Gerekli Maven bağımlılıkları IntelliJ IDEA tarafından algılanması için bir miktar süre geçicektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xSls6Zs4N6fWd4sT.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CCrzEC9b1yWY-4aD.png" /></figure><p>1–2 dakikalık bir bekleme süresinin ardından proje kullanıma hazır olucaktır. Yukarıdaki Resimde de görebileceğiniz gibi sağ üst köşedeki Yeşil Play iconu olan butona basarsanız uygulama çalışıcaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tQjLA16gVbqt-AcX.png" /></figure><p>Bu makalemizde Spring Boot Projelerinin IntelliJ IDEA ile nasıl açılıp çalıştırılacağını görmüş olduk. Artık Spring Boot Projeleri geliştirmeye başlayabilirsiniz.</p><p>Örnek Spring Boot Projeleri için GitLab üzerindeki arşivimize göz atabilir</p><p><strong>GitLab Link:</strong> <a href="https://gitlab.com/yazilim.vip/spring">https://gitlab.com/yazilim.vip/spring</a></p><p>Bu projelerin adım adım nasıl geliştirildiğini öğrenmek için Spring Boot ile ilgili yazılarımızı okuyabilirsiniz.</p><p><strong>Link:</strong> <a href="http://yazilim.vip/java/spring-framework/">http://yazilim.vip/java/spring-framework/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efd31792c7da" width="1" height="1" alt=""><hr><p><a href="https://medium.com/yazilim-vip/intellij-idea-%C3%BCzerinde-spring-boot-projesi-nas%C4%B1l-a%C3%A7%C4%B1l%C4%B1r-efd31792c7da">IntelliJ IDEA üzerinde Spring Boot Projesi Nasıl Açılır?</a> was originally published in <a href="https://medium.com/yazilim-vip">Yazilim VIP</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>