フレクトのクラウドblog re:newal

http://blog.flect.co.jp/cloud/からさらに引っ越しています

MuleSoftの特徴である「API-led Connectivity」とは?

みなさまこんにちは、CI事業部の釜谷です。

フレクトでは、2020年度からMuleSoftに注力しています。 MuleSoftに興味のあるそこの貴方!是非フレクトにお問い合わせください!!

今回は、MuleSoftの特徴である「API-led Connectivity」についてお話ししたいと思います。

blogs.mulesoft.com

API-led Connectivity(API主導のシステム間連携)は、再利用可能な3つの層(Experience、Process、System)に所属するAPIを使用してデータとアプリケーションを接続する方法です。

各層の概要は以下になります。

各層の説明
APIの種類 説明
Experience API
(ユーザーエクスペリエンス)
APIを使用する様々なクライアント(デバイス・Webシステムなど)に応じたAPIを提供する層です。APIを使用するクライアントは、API内のビジネスロジックやデータベース操作などを気にする必要はありません。APIは、複数のProccess APIやSystem APIを組合せてサービスを提供します。
Process API
(業務プロセス)
ビジネスロジックを提供する層です。複数の System API を組み合わせて、業務的な機能を提供します。
System API
(ソースシステム)
外部システムとの連携やデータベース操作などの機能を提供する層です。再利用性を高くするために業務色をできるだけ排除した設計になっています。

複数の層に分けることでAPIの再利用がスムーズに行うことが可能になり、新規APIAPIの機能拡張時の開発コストの削減につながります。

例えば、Experience API:電話受付API(Process APIハンバーガー注文API、System APIハンバーガAPI)以外に、Experience API:Web受付APIを新規開発したいとき、Process APIハンバーガー注文API、System APIハンバーガAPIを再利用するだけで、APIの開発が可能になります。

本記事で、少しでもMuleSoftに興味を持って頂けたら幸いです!

MuleSoft Alertについて

こんにちは。CI事業部の川瀬です。

今回は運用で役立つAlert通知について説明します。Alertと言えば、キャパシティ管理でCPUの利用率が70%を超えたら通知、5分回にXX回以上のエラーが発生したら通知ということを思い浮かべる人が多いと思います。勿論、MuleSoftのAPI Platformでもいろいろな通知方法が提供されています。このいろいろという所が実は悩ましいです。

では、実際に機能を見ていきましょう。

Runtime Mangerによる通知
ここでは、以下の通知が提供されています。

  • Deployment failed (デプロイに失敗しました)

  • Deployment success (デプロイメントに成功しました)

  • Secure data gateway connected (ソースデータゲートウェイが接続されました)

  • Secure data gateway disconnected (ソースデータゲートウェイが切断されました)

  • Worker not responding (ワーカーが応答していません)

実際の設定画面はこんな感じです。

f:id:k2-flect:20210417202129j:plain:h426:w298

docs.mulesoft.com

API Mangerによる通知

  • CPU Utilization (CPU 使用率)

  • Memory Utilization (メモリ使用量)

  • Thread Count (スレッド数)

  • Message count (メッセージ数)

  • Message error count (メッセージエラー数)

  • Message response time (メッセージ応答時間)

実際の設定画面はこんな感じです。
f:id:k2-flect:20210417203332j:plain:h267:w321

docs.mulesoft.com

Monitoringによる通知

  • API を管理する 1 つ以上のポリシーで違反が発生する。

  • 要求数
    ユーザが指定された期間で許可されている回数を超えて API にアクセスを要求する。

  • 応答コード
    API が要求を受信したときに、400、401、403、404、408、500、502、503 のいずれかの HTTP コードを返す。

  • Response Time (応答時間)
    API応答時間が指定された期間を超えている

実際の設定画面はこんな感じです。
f:id:k2-flect:20210417203636j:plain:h466:w305

docs.mulesoft.com

Monitoringのカスタムダッシュボードでの通知
カスタムダッシュボードで設定したメトリクスに応じて設定できる項目が変わります。 実際の設定画面はこんな感じです。
f:id:k2-flect:20210417203853j:plain:h377:w726

MonitoringのFunction Monitoringでの通知
期待するHTTPレスポンスを定期的に監視することができます。例えば、死活監視を設定することができます。 実際の設定画面はこんな感じです。
f:id:k2-flect:20210417205236j:plain:h387:w558

Runtime ManagerによるAlert通知はどのライセンス形態でも使用できますが、その他のAlert通知はライセンス形態により使用できない場合があるので注意してください。

いろいろな個所でAlert通知ができるので、最初のうちは混乱してしまうかもしれませんが、ライセンスに応じでできることがどんどんできることが増えていくと考えればよいです。
ここでクイズです。Function Monitoringで死活監視ができますが、Runtime ManagerのWorker not respondingを使用しても死活監視ができます。どちらを使えばいいでしょうか?
即時性を求めるならFunction Monitoringです。Runtime ManagerのWorker not respondingによる通知は、若干、時間がかかります。ただし、Function Monitoringではバッチ系のアプリに対し死活監視ができません。その場合は、Runtime ManagerのWorker not respondingを使うしかありません。

MuleSoft でSalesforceと連携しよう!!

みなさまこんにちは、CI事業部の釜谷です。

フレクトでは、2020年度からMuleSoftに注力しています。 MuleSoftに興味のあるそこの貴方!是非フレクトにお問い合わせください!!

今回は、MuleSoftでSalesforceと連携する方法を紹介してみたいと思います。

例えば、SalesforceのAccountオブジェクトのレコード情報を取得する場合、以下の作業を行います。

まず、MuleSoft開発に必要なAnypoint Studioを用意します。 docs.mulesoft.com

次に、Salesforceと連携するために、Salesforce Connectorを用意します。 MuleプロジェクトのMule PaletteにSalesforceを配置します。 Salesforceを配置すると、Package ExplorerSalesforce Connectorがインポートされます。 docs.mulesoft.com

次に、Salesforceへの接続情報を設定するために、Salesforce ConnectorのSalesforce Configを使用します。 Salesforce Configに、以下を設定します。

f:id:flect-kamatani:20210331211658p:plain
Salesforce Config イメージ

Salesforce Configの設定ですが注意事項があります。 * 連携先のSalesforceでIP制限をかけている場合、Security tokeの設定は不要になります。その代わり、authorization URLの設定は、https://test.salesforce.com/services/Soap/u/49.0、などの工夫が必要になります。 * Muleプロジェクトの実行直後に、Salesforceとの接続確認を行うためTest Connectionが自動実行されます。接続失敗した場合は、設定内容などの対処を行います。

最後に、レコード情報を取得するため、Salesforce ConnectorのQueryコンポーネントを使用します。 このコンポーネントSalesforce queryに、レコード取得用クエリーを記入します。 例えば、SELECT Name, LastModifiedDate, BillingPostalCode FROM Account、を記入します。

f:id:flect-kamatani:20210331211749p:plain
Queryコンポーネント イメージ

フロー起動用のListnerコンポーネントSalesforce取得データをJSON形式に変換するTransform Messageコンポーネントを追加して完成したフローイメージは以下になります。

f:id:flect-kamatani:20210331211624p:plain
フローイメージ

Salesforce ConfigとQueryコンポーネントを使用するだけで、Salesforceからレコード情報が取得できます! MuleSoftでのSalesforceの連携作業は、他システムの連携作業と比べて、とても簡単にできると思います。 Anypoint Studioは無料トライアルできるので、興味が沸いた方は是非お試しください!!

Use indoor positioning system (IPS) on AR Remote Instructions base on ARKit

研究開発室の馮 志聖(マイク)です。

Content

  • Introduction
  • IPS (Indoor Positioning System)
  • Solution
  • Conclusion
  • Other
  • Reference

Introduction

When we want to go to an unknown location, we will use maps to navigate. In the era when the global positioning system was not popular, people used paper maps. With the development of science and technology, almost all modern navigation systems use the Global Navigation Satellite System (GNSS), and many countries have developed their own positioning systems, among which Global Positioning System (GPS) is more commonly used. GPS will use trilateration to locate the user's current location and set the path to the destination. GPS positioning is used when outdoors.

Why we need indoor positioning system (IPS)?

However, in the indoor environment, it is difficult for GPS to provide reliable positioning information due to signal attenuation and blocking caused by buildings and construction materials. Thus the location-based apps such as Navigation don’t work inside airports, malls, subways, etc. GPS doesn’t provide information about the floor and building level where the user is located. These factors led to the need for a system where a user can be located inside a building accurately and precisely to make positioning and navigation inside indoors as easy as outdoors.

GNSS https://en.wikipedia.org/wiki/Satellite_navigation

GPS https://en.wikipedia.org/wiki/Global_Positioning_System

Trilateration https://en.wikipedia.org/wiki/True-range_multilateration

Association of indoor positioning system (IPS) and AR remote instructions system.

This is the previous blog about AR remote instruction.

AR Remote Instructions base on ARKit - フレクトのクラウドblog re:newal

In AR remote instruction, the supporter or the client will have a problem, that is very often unable to find the target location and cannot provide assistance. Almost all locations are indoor environments, such as warehouses or offices.

Therefore, we searched some existing research information to investigate which research methods are suitable for AR remote instruction.

続きを読む

TFLiteをWasm化(WasmSIMD化)してGoogle Meet 仮想背景機能を動かす

こんにちは。研究開発室の岡田です。

以前、Google Meetの仮想背景のモデル(Segmentation Model)をTensorflowjsで動作させた記事を投稿しました。今回はさらなるパフォーマンス改善を目指しWasm化したTFLiteで動かしてみようと思います。

結果、かなりの好成績でした。 image

続きを読む

MuleSoftを感じてみる

こんにちは。CI事業部の川瀬です。
フレクトでも2020年度から新しい技術、MuleSoftに取り組んでいます。

MuleSoft一体どんなもので、どんな会社が使っているのか?と見てみると以下のリンクに辿れます。

www.mulesoft.com

トヨタNETFLIXも使っているのですね。

MuleSoftを使うと何がいいのでしょうか? ERPの代表格としてはSAP、Oracle富士通、ORBICなどの有名どころがあります。じゃ、プログラム書いて繋いじゃえばいいじゃないかと思います。 ところが実際は、業務Aを実行するにはシステムA、業務Bを実行するにはシステムB、挙句の果てには途中でデータ加工のためAccessやエクセルが出てくる場合もあります。 システムAからこのデータを取得して、システムBからはあのデータを取得して、ムムムとなってしまいます。
簡単にデータを取得して、うまいことと混ぜて画面に表示したい、ということでMuleSoftが着目され始めています。 もちろん、接続先をプラグイン化して様々なシステムにつなげることができる凄腕エンジニアがたくさんいれば話は別です。
対向システムのAPIを調べ、今度は別の対向システムのAPIを調べといった具合に、エンジニアの立場からは面白いかもしれませんが、経営者からみたらたまったものではありません。早い、安い、うまいが基本ですよね。
そんな中でMuleSoftは各種コネクタを用意してあり、簡単に対向システムと接続できちゃいます。

docs.mulesoft.com

一体、MuleSoftと通常の実装とではどこが違ってくると思いますか?比較すると以下のような感じになります。

          MuleSoft               カスタムコード(Java)                 
API 仕様 1. API 仕様を GUI の専用ツールで作成。シンタクックスの習得不要。
2. API 仕様に基づき API を実装
成果物:RAML / OAS
1. API 実装をコーディング
2. API 仕様を自動で生成
成果物:RAML/OAS
API 実装 GUI でフローを作成
データの変換部分のみ少量のコーディング
Eclipse 等の IDE 上でインテリセンスを活用してコーディング
具体例
f:id:k2-flect:20210321142424p:plain
実装例
public class DBSample {
public static void main(String[] args) throws Exception{
Connection conn = null;
...

どうですか?簡単そうでしょう。次回はもっと具体例と出したり、他の製品との比較もやっていきたいです。

Manipulate AR objects using UI Gesture and Hand Gesture

This is Shuochen Wang from R&D department in Flect. In this blog I am going to explain how to move AR objects by both translation and rotation using UI Gesture and Hand Gesture.

Table of contents

  • Introduction
    • Why do we need to learn about AR?
    • Why use Apple for AR apps?
    • What is the difference between VR, MR and AR?
    • What is ARKit?
    • What is SceneKit?
    • What is UI Gesture?
    • What is Hand Gesture?
  • Start Up
    • Setting up the view
    • Adding AR objects
  • Setting up UI Gesture recognizers
    • Setting up the Pan Gesture for Translation
    • Setting up the Rotation Gesture for Rotation
  • Setting up Hand Gesture
    • Setting up Hand Gesture for Translation
    • Setting up Hand Gesture for Rotation
  • Conclusion
  • Reference

Introduction

Why do we need to learn about AR?

The need to learn about AR (Augmented Reality) has become more important than ever. In 2020, AR has disappeared from Gartner’s Hype Cycle. This means

AR has reached maturity and became an industry-proofed technology that executives can safely invest in to improve and innovate their business.(AR Post)[^1]

In other words, AR is going to be an essential technology to be used behind other new, trending technologies. As a software developer/ engineer, one needs to learn how to use AR.

続きを読む