iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 12
2
Elastic Stack on Cloud

後端碼農程序猿,來寫on cloud是不是搞錯了什麼,俺想耕田呀系列 第 12

再不耕田受不了啦!!從這篇開始造飛機,讓農夫們都能體驗天上飛的感覺吧!!(1)spring boot connect to elastic on Cloud!!(new Porject)

如題跟朋友聊天炫耀有來寫這個主題
爲了那個elastic 聯名款保溫瓶,殊不知他的評論:你不是碼農?怎麽都沒扣?

欸?聽到這個就覺得好像不把專長跟主題合在一起,廣大碼農們哪知道怎麽連到on cloud?

於是乎stackoverflow.com敲下spring boot connect to elastic on cloud...

然後去git找找,去google找找,能找的地方都去找,公司寫的集成太大,職業道德也隱隱作祟

好吧,只能自己刻了,接下來未知篇數的耕田,let's start!!

要命喔我的天....都沒時間寫文章了,加班爆表,然後還要自己刻輪子

從開專案開始吧

1. 基本上這篇還是主要是講ES所以spring boot的部分就是蜻蜓點水

直接intellij spring boot,然而對這神好用的東西不熟的銅學
任意門幫你們放這了
spring boot30天手把手必收文章

2. 用上現在市場主流的java8 lambda是好物

對lambda不熟的銅學,這裏也有邊好文收着

3. 最後來引入常用 maven 這次只要引入lombok就好了 (get/set真是太煩了) ,這邊有spring data es這個先不用~

不知道此等神物的銅學也請點 -> 任意門

4. 然後直接下一步到專案創建完成DO RE MI SO~

草率到不行的專案就此完成了呢

這個專案會同步到這裏,爲了不劇透,開了個新的重頭來~

反正最後一定動的起來XDD

最後附上 pom.xml檔,專案啓起來應該是要長這樣的留意版本號囉

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.ithelp.ironman</groupId>
    <artifactId>ec-demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>ec-demo</name>
    <description>connect to elastic by jacky</description>
    <packaging>jar</packaging>


    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
       
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


對於文章中的任何用詞與專業字或都可以在下面留言提問

梗圖看不懂也行

蔽農會帶着謙卑爲懷的心情竭盡所能回覆與說明的


上一篇
地面助跑完了,回來天上看看這裏還好嗎?第11篇還有23天試用,我佛慈悲
下一篇
再不耕田受不了啦!!從這篇開始造飛機,讓農夫們都能體驗天上飛的感覺吧!!(2)spring boot connect Elastic on Cloud 開始找農具與整地啦
系列文
後端碼農程序猿,來寫on cloud是不是搞錯了什麼,俺想耕田呀32
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言