by LINE Engineer on 2016.11.1
Hi, my name is Watanabe and I’m in charge of the development of LINE Notify. In this post, I’d like to share how developers can use LINE Notify to send messages to LINE straight from the command-line.
Up until now sending system messages to LINE either required a Bot API Trial or Business Connect account. While both are improved by Messaging API and provide many great features, they require a high level of implementation.
LINE Notify is an API that has a limited set of features, streamlining the whole process of sending messages to LINE.
Sending messages using cURL
By generating your own “personal access token” through LINE Notify, you can send messages by sending an HTTP POST request to the API endpoint. Any method can be used as long as it uses an HTTP request. In this post, let’s go over how you can use the HTTP client cURL.
Generating personal access tokens
You can generate your own personal tokens by navigating to My page (LINE account required).
When you click the “Generate token” button, you will see a screen where you can name your token and select a target that you will send messages to when the token is used.
Use an easily recognizable name for your token. When selecting message targets, selecting “1-on-1 chat with LINE Notify” will make the LINE Notify official account send a message to you. Selecting a group will make the LINE Notify official account send a message to the selected group.
You can change message targets on each token. To send messages to separate chats, you can generate individual tokens for each chat.
Your generated access token will not be shown to you again. You will need to keep the token written down, or else you will need to delete the token and generate a new one. More »
by LINE Engineer on 2016.10.26
This is Oklahomer from LINE Corp. In this post, I’d like to explain the architecture behind the chatting function of LINE LIVE, a video streaming service.
LINE LIVE for iOS and Android has a chat feature that lets its users send comments in real-time while they are watching a live-streaming video. This not only lets users (or viewers in this case) communicate with each other, but it also lets the streamers connect with their viewers. Streamers can chat with their viewers back and forth, and sometimes plan their videos according to what the viewers say in the chat. This is why the chat is an integral part of the streaming experience.
As you can probably imagine, celebrity live streams attract a large number of viewers, and along with them a torrent of comments. Comments sent to the stream must be simultaneously broadcast to every other viewer, and effectively distributing the load has always been one of our top-priority tasks. There are sometimes 10,000 comments sent per minute on just one stream alone.
We took the possibility of large amounts of comments into consideration when we were developing LINE LIVE and presently have over 100 server instances in operation for the chat feature.
More on the server architecture below.
Overall server architecture
Below is the overall architecture of the server.
by LINE Engineer on 2016.9.29
Hello, this is Momoki from the LINE Developer Day preparation committee.
LINE Developer Day has always been a gathering place for sharing various technological experiences and global challenges and trends, and LINE Developer Day 2016 has just successfully come to a close.
You’ve shown us a great amount of support by registering for the event, so much so that we could only invite a few that were selected from a draw.
We regret that we could only invite about 1000 of you to the event but we thank you all for showing tremendous support all the same!
At LINE Developer Day 2016, our engineers talked about our chatbot tactics, along with the announcement of the LINE BOT AWARDS. There were also live coding sessions, sessions about the structure of our message encryption method called “Letter Sealing,” sessions on how we handle large amounts of data transfers for LINE LIVE and LINE group calls, and sessions on how we handled large scale service outages. There were a total of 17 sessions at the conference, introducing our technologies and talking about other topics.
The slides are available through the links below.
by LINE Engineer on 2016.8.19
Hello, my name is Yuto Kawamura. I’m a LINE server engineer in charge of developing and operating LINE’s core storage facilities such as HBase and Kafka.
Since the latter half of last year, I’ve been working on a new project called IMF, which stands for Internal Message Flow (or Fund). IMF has two main goals:
- Develop a data pipeline which provides a unified way of delivering events between our systems.
- Replace talk-dispatcher, a component in the LINE server system responsible for background task processing.
The two goals may seem unrelated, but we’re actually trying to adopt the same technologies for both; Apache Kafka and stream processing. Apache Kafka is a high-throughput distributed messaging system that was originally developed and used at LinkedIn. Although Kafka has various unique features, the most important ones are the following:
- Disk-based persistence with high throughput which is near in-memory through the use a page cache
- Ability to have multiple consumers consume messages from a topic (similar to a queue) multiple times because each client manages “offsets” which represents the position in the queue that consumption has caught up to
There are many interesting things that I could tell you about our work, such as the practices we’ve defined while working on Kafka engineering or the bigger picture of what the IMF project is about. But today, I’d like to focus on just one thing: How we implement stream processing.
by LINE Engineer on 2016.8.11
In New generation of safe messaging: “Letter Sealing”, we announced that end-to-end encryption (E2EE) has been made available on LINE messages.
But we’ve made even more improvements to safe messaging over the past few months, expanding Letter Sealing to features other than one-on-one chats. We’d like to share some of them here in this post.
Letter Sealing is now enabled on one-on-one chats by default
In the previous version of LINE, you had to opt in to use Letter Sealing. With the latest version we’ve made it so that it’s enabled by default. You can still opt out if you wish to do so.
One reason we couldn’t enable Letter Sealing by default for everyone was because of an issue we had with the iOS push notification system. LINE displays a small part of the messages you receive through push notifications. Unlike on Android, the push notifications on iOS gives apps much less room to work with. When someone sends a message to you, the servers normally only send part of the message to you through a push notification. The LINE server cannot read these Letter Sealing-enabled messages and thus can’t display the contents of the message on the notification.
Fortunately, a new type of notification called VoIP push notification was added to iOS 8. We were able to display the contents of messages using VoIP notifications to run the LINE app to decrypt encrypted messages. The team confirmed that VoIP notifications were very stable starting with iOS 9.3.1, and decided that Letter Sealing wass ready to be enabled as a default option.
Letter Sealing can now be enabled in group chats
Your messages are now safer even in group chats.
Messages inside a group chat with Letter Sealing enabled can only be encrypted by users in the same chat. When someone leaves the group, that user is no longer be able to decrypt the messages sent in the group.
Another thing to consider is that users in a group chat are not always online at any given time, and can’t always receive messages right away in real time. This limitation made applying Letter Sealing to groups much harder than applying it to one-on-one chats. We took these issues into consideration and spent a whole year tweaking and testing Letter Sealing so it is finally ready to be available on group chats in the latest version of the LINE app (LINE 6.5 for iOS and Android). For now, it’s only available for group chats that have up to 50 members, but we’re working on increasing this number to support larger group chats.
I’ll explain more on how LINE engineers dealt with these problems in an upcoming post.
Letter Sealing is now available on free calls (voice/video)
LINE has offered free voice and video calls since 2011. After discussing what features we should provide Letter Sealing to next, the team decided that we should start work on developing Letter Sealing for free calls.
Voice and video calls are now protected by an encryption key only known and exchanged between participants of the call. Even LINE employees cannot see what’s going on in these calls as the calls are protected by an encryption key, which is only stored on user devices and not on LINE servers.
No additional manual settings are required for using this feature. Users on LINE 6.5 (iOS, Android) or LINE 4.8 (Windows) and above can enjoy the extra protection provided by this security upgrade if they keep Letter Sealing enabled.
You can now easily tell if Letter Sealing is enabled
Your messages on LINE are still safe even without Letter Sealing, as they are encrypted when they travel between your device and our servers. No one can know about your messages even if they are monitoring your network. The reason we developed Letter Sealing was to add an extra layer of protection so that your messages can only be seen on your devices and kept safely encrypted on our servers.
After introducing Letter Sealing last year, the team hotly debated about adding a status indicator for Letter Sealing. We didn’t want to give our users the impression that chats without Letter Sealing are unsafe nor did we want to cause confusion on who you can use Letter Sealing with and who you cannot, since Letter Sealing was disabled by default when it was first introduced.
Now that Letter Sealing is enabled by default, we decided that it’s more important to give correct information to our users rather than dwell on these concerns. Starting with LINE 6.5 (iOS, Android) and LINE 4.8 (Windows, Mac), you will notice a padlock icon next to the name of the chat when you’re in chats or calls with Letter Sealing enabled.
The status indicator will be gradually rolled out to the various regions around the world. All users using supported versions of the LINE app should be able to see the status indicator displayed on Letter Sealing-enabled chats by the beginning of September.
We plan to bring all the security features mentioned above to platforms other than iOS, Android, Windows, and OS X1 as well. Our mission is to keep messaging safe on LINE, and we will continue to do so.
1: The status indicator will be displayed on one-on-one chats and group chats on LINE 4.8 for Windows and OS X. Status indicators for free calls will be available with the next update.
About the author
Shin, Ki Bin: A LINE engineer working on the messaging server.
by LINE Engineer on 2016.8.8
We’ve already announced LINE Developer Day 2016. Today, we’re happy to announce that the official website and registration forms are also available.
- Date/Time: September 29, 2016 from 10 a.m. to 6:30 p.m.
- Place: Shibuya Hikarie, 9F, Hikarie Hall
- Invitees: Application and web engineers
- Admission: Free
- After-party: To take place in the Hikarie Hall after the event
You can register for the conference here. (Registrations are open until September 15)
We have 50 seats reserved for press and 450 seats for regular attendees. We would like to kindly remind you that the 50 seats reserved for press are meant for attendees that regularly post on their blogs or other social media, and are willing to write an article covering the event after the conference is over. We will send an email confirming your registration on September 22 if you are selected as an attendee. (Attendees will be randomly selected if the number of registrations exceed 450)
Check the schedule on the official LINE Developer Day 2016 website
Scheduled to take place in the same venue with no additional fee required
Official Twitter hashtag: #linedevday
We are looking forward to meeting you all.
About the author
Kushii: In charge of actively and creatively promoting the technologies of LINE both in and out of the company. Also in charge of operations of LINE Developer Day 2016.
by LINE Engineer on 2016.8.5
If you have yet to read the introductory article to circuit breakers, I recommend you read the following article first: Circuit Breakers for distributed services
Applying CircuitBreaker to Channel Gateway
Channel Gateway servers provide various LINE server features to content providers. This is why Channel Gateway servers are highly affected by the servers they are connected to, with the effects easily spreading across all Channel Gateway servers.
It was when I was struggling to think of a solution to this problem that I first heard about circuit breakers. Circuit breakers seem to be what I was looking for since they are able to detect a problem in certain servers, blocking all requests that the server would have otherwise received. With that in mind, I decided to apply circuit breakers on Channel Gateway.
While I could have implemented my own circuit breakers on Channel Gateway, there were already excellent circuit breakers on Armeria. Armeria enables you to set various options on circuit breakers when you implement them using
CircuitBreakerBuilder, generating your own
CircuitBreaker object as a result. I was able to easily apply a customized circuit breaker on Channel Gateway thanks to this system.