비동기 메시지 처리 시스템(2)- RabbitMQ 설치

이미지
개요 RabbitMQ 는 Advanced Message Queuing Protocol (AMQP) 를 구현한 오픈소스 message broker 이다. RabbitMQ 서버는 Erlang 프로그래밍 언어로 작성되고, 클러스터링 및 failover를 위한 오픈 통신 플랫폼의 프레임 워크가 내장되어 있다. AMQP에 대한 내용을 먼저 알고 있어야 하는데  http://killins.egloos.com/m/3025514   에서 참조 할 수 있다. 또는  http://blog.saltfactory.net/90  에서는 기본 개념과 설치 방법을 포스팅 하고 있으니 참조 할 만 하다. RabbitMQ 설치   1. erlang 다운 및 설치      http://www.erlang.org/download.html 에서 window용 파일을 다운받아 설치   2. rabbitmq window버전 다운 및 설치      http://www.rabbitmq.com/download.html      에서 installer버전을 다운받아 설치   3. plugins 설치      명령프롬프트에서 c:\Program Files\RabbitMQ Server\rabbitmq_server-x.x.x\sbin      으로 이동후      > rabbitmq-plugins enable rabbitmq_management 실행           4. RabbitMQ 서비스 재시작  5. http://localhost:15672 로 접속 하여  monitoring

비동기 메시지 처리 시스템(3) - RabbitMQ toturial(1)

이미지
RabbitMQ toturials는  rabbitmq  에 잘 정리되어 있음. eclipse & maven 기반으로 toturials을 실행하기 위해서 먼저 아래와 같이 dependancy를 pom.xml파일에 추가한다. 1. maven dependancy     <dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>3.2.2</version> </dependency> 2. 첫번째 샘플인 Sending & Receiving 부터 마지막 RPC 예제 소스를 다운받아 eclipse에서 실행해보면 기본적인 이용방법을 알수 있다.  http://www.rabbitmq.com/tutorials/tutorial-one-java.html 3. 예제를 실행하면 rabbitmq의 관리페이지에서 다양한 view를 확인할 수 있다.

비동기 메시지 처리 시스템(1)-JMS, RabbitMQ

1.개요 ㅇ비동기/병렬처리( QUEUE ):대량 메시지 처리성능을 위해 반드시 적용 ㅇ동기처리시 문제.. -트랜잭션이 늘어나면 대기하는 요청들이 늘어나 정체 -> 서버다운 -병렬 처리 못함 -> 응답시간 지연. ㅇSpring Integration:비동기 병렬처리를 손쉽게 구현. - spring 기반의 bean들과 설정들을 그대로 사용할 수 있어 매력적임 - Task-executor를 이용한 단순한 구조였음에도 훌륭한 성능. ㅇ 개선점 ( In memory channel 기반 시스템의..) - decoupling : .producer와 consumer간 직접연결로 인한 확장성 문제. .주소가 바뀌거나 , 서버이전하거나..( Physical decoupling) .어느 한쪽의 logic이 변경되면......( Logical decoupling ) - 시스템 에러시 queue에 있는 데이타는 유실 - load balancing, clustring .. - 큐의 상태에 대한 모니터링 도구가 없음. ㅇ 보다 견고한 시스템 구성이 필요 -> jms, mq 등의 시스템 구성.. 2. JMS vs RabbitMQ ㅇJMS : 메시지 처리에 대한 J2EE API. OpenMQ, HornetQ, ActiveMQ가 이에 해당하는 제품들임 ㅇRabbitMQ : AMQP 프로토콜을 지원하는 오픈소스 메시징 시스템 (AMQP란 -> http://killins.egloos.com/m/3025514 ) ㅇ둘의 차이점 [원본] http://java.dzone.com/articles/jms-vs-rabbitmq 1) Messaging Model ...

Application mornitoring tool - Spring Insight

[download] http://gopivotal.com/products/pivotal-tc-server [forum] http://forum.spring.io/forum/spring-projects/management/insight 개요 - What is Spring insight? http://www.youtube.com/watch?v=nA4SXDl2EFU http://www.youtube.com/watch?v=nBqSh7nVNzc 어플리케이션 모니터링 도구임. 설치 tcServer? Spring insight는 Pivotal의 tcServer에 내장되어 있다고 하며 tcServer는 Tomcat을 개선하여 기능을 추가한 것이라 함. 여기서 기능은 Spring 어플리케이션의 리로드, 모니터링 도구인 Spring insight 내장이라함.  리로드는 소스 수정후 서버재시작이 없이 반영하여 개발 효율성을 높인 것이라함.  발췌 [ Spring tc Server와 Spring Insight 소개 - Tistory ] tcServer에 내장됬다고 하는 Insight만을 뽑아서 익숙한 Tomcat에 설치하는 방법 tomcat에 설치        1. download            http://gopivotal.com/products/pivotal-tc-server  에 접속하여 간단한 회원가입후          Pivotal tc Server Developer Edition Runtime (zip) 파일을 다운받음        2. 압축을 풀고 아래 파일을 Tomcat이 설치된 폴더로 옮김            [tcServer]/templa...

How can I make a multipart/form-data POST request using Java?

@see http://stackoverflow.com/questions/1378920/how-can-i-make-a-multipart-form-data-post-request-using-java 1. maven dependancy org.apache.httpcomponents httpcore 4.2.5 org.apache.httpcomponents httpclient 4.2.5 org.apache.httpcomponents httpmime 4.2.5 2. source package sample; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; imp...

Hot Deploy - 3 ways to save development time ( spring-loaded , JRebel, DCEVM )

이미지
1. Auto Reload Set  "Enabled" to "Auto Reload" This is likely to occur more frequently memory leak, it takes more time to reload. 이 방법은 memory leak 이 더 자주 발생할 가능성이 크고, 리로딩 하는 시간이 더 많이 소요된다. 2. JRebel  Installation JRebel Config Center -> Activation Tab -> Free -> Login -> Install and Activate -> Copy License Code -> Paste license code on eclipse ->   Overview tab -> check JRebel Enabled /Server , Projects  Server Overview -> select "Never publish automatically" on  Publishing tab -> check "Enable JRebel agent" Project Left click -> JRebel -> Add Jebel nature JRebel free license version other than the cost should be paid. The installation process is a little complicated. But first, rather than memory leak may occur JRebel free license 버전이외는 비용지불을 해야 한다.  설치과정이 다소 복잡하다.  memory leak이 발생하지만 1번과 비교할 바는 아니다.  가장 안정된 솔루션 3. spring-loaded  I...

ESAPI ( XSS, Sql Injection )

OWASP 에 ESAPI는 XSS  및 Sql Injection 방어를 위한 API [link]    https://www.owasp.org/index.php/Main_Page [youtube] http://www.youtube.com/watch?v=suphwAsb-To http://www.youtube.com/watch?v=13O9RyjuB3o http://www.youtube.com/watch?v=_B2kv2mSJhE http://www.youtube.com/watch?v=mMW4fiUI5kQ dependency 추가  org.owasp.esapi esapi 2.0.1     2. ESAPI.properties 파일을 만들어 아래 내용을 추가한 후 classpath에 넣는다. Authenticator.UsernameParameterName=userName Authenticator.PasswordParameterName=password ESAPI.Authenticator=com.esapi.authenticator.CustomAuthenticator Authenticator.IdleTimeoutDuration=100000 Authenticator.AbsoluteTimeoutDuration=100000   Test code import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import org.owasp.esapi.codecs.Codec; import org.owasp.esapi.codecs.OracleCodec; public class EsapiTest { public static void main(String[] args) { String a = "<script>alert('dddd')</script>"; String b = ESAPI.encod...